0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 12:02:16 +02:00
Commit Graph

11 Commits

Author SHA1 Message Date
Houssam Salem
d65b6c21ab Don't scan media on every sync and expose media checking to UI
The media checking functionality has been completed and exposed to the user in the UI. 

With this commit, AnkiDroid will no longer scan (or even attempt to scan) for media changes on every sync. Changes made to media through AnkiDroid are recorded in the media database directly. If the media directory is modified externally (e.g., with a file manager),  the user must use the media checking feature to update the media database by scanning all files again.

Other changes:
 - Adding media files through imported decks also mark file additions in the media db
 - The multimedia note editor now uses the media manager to add files instead of copying files directly (which marks additions in the media db)
 - Fixed issue where non-temporary media wasn't copied over in multimedia note

Includes commits:
display more feedback when syncing media (cf801e4fb4)
we need to count up for downloads (3ee1937310)
2014-09-15 01:03:36 +10:00
Houssam Salem
86c6413978 Updated media adding function and media tests.
Media add now correctly normalizes file names.
Media tests no longer clear the primary collection.media folder on a device.

Also removed the public getCurrentAnkiDroidMediaDir() method because:
1 - It makes an assumption about the collection name (it's wrong)
2 - You can get it from the media manager if you need it
3 - You shouldn't need to access it as all media operations should be done through the media manager anyway.
2014-09-02 19:27:26 +10:00
Houssam Salem
69a99c8b2b fix media test
354fbd33f6

Small extra changes:
 - fixed null character in testIllegal()
 - make sure we fail if we try testing on older APIs.
 - renamed deck to col in method
2014-09-01 18:45:20 +10:00
Houssam Salem
1ce09d960d Disable media sync on Android <=2.2 if non-ascii file name found
Unicode normalization is not supported on Android 2.2 and below. Since the new media sync protocol requires file names to be normalized in NFC form, we now abandon a media sync if we detect a media file name that cannot be entirely represented in the ASCII encoding and disable media syncing on that device.

This approach is likely to allow a number of users on those devices to still be able to sync media without issue.

Note: A dialog is shown if media becomes disabled after a sync. Collection syncing is unaffected.
2014-07-27 20:41:28 +10:00
Houssam Salem
834e623de1 New media sync protocol and updates to media handling
The main features of this commit:
1 - Port of the new media sync protocol (released in Anki 2.0.27)
2 - Cleanup and update of Media.java to match Anki 2.0.27

Things to note about this commit:
- Tests for the Media class have been ported over.
- A new media database format has been added with the extension ".ad.db2". The .ad prefix is specific to AnkiDroid to prevent issues caused by copying the file to the desktop or vice versa. If an old media database is found, it will be converted to the new format (and if it fails for some reason, it creates a new empty database).
- File names are now normalized in NFC form before being added to the database and/or synced (previously used NFD, which is not the format used by Anki)
- Media-related regular expressions have been fixed and the group indexing scheme documented (Java doesn't support the named groups that python uses)
- Previously, a clean copy of the media database was cloned from the assets folder. With this update, it is created at runtime with SQL, so the file in assets has been removed.

Known issues;
The multimedia note editor bypasses the Media manager for most of its tasks which could lead to inconsistencies in the future.
2014-07-20 01:38:57 +10:00
tim.home
f882bd3dec fix whiteboard state not loading
Change preference name from "show whiteboard" to "enable whiteboard"
2014-04-13 02:10:20 +09:00
Alexander Grüneberg
45a766de85 Update build files creation script. 2014-04-04 23:06:14 -05:00
Nicolas Raoul
0111ba9ee0 Eclipse now seems to favor this order, why not 2013-10-09 19:23:29 +09:00
Flavio Lerda
0ddee387da Update to the latest version of Android.
This commit updates the AndroidManifest.xml to target the latest SDK:
this prevents compatibility behavior on latest version of the OS.

Moreover, update the tools used by Travis CI to the latest and greatest.

Finally, make the download a bit let verbose and easier to debug.
2013-08-11 22:44:45 +01:00
Nicolas Raoul
793bc15c9d Upgrade to the latest android SDK and tools.
The latest version of the android command now requires a --target
argument to be specified.
2013-07-04 15:51:09 +01:00
Flavio Lerda
49d6fd9734 Remove Unescaper class.
The class had a dubious copyright and can be easily implemented using
the Android APIs.

This commit also adds a test project that I used to create a couple of
simple unit tests for the newly added code.

The project can be configured in Eclipse by importing the tests
directory as a new project, as well as with ant, running "ant test". See
the README in the tests directory for more details.
2013-06-20 08:11:32 +01:00