Anki/anki
Damien Elmes be045d451c remove the media table
The media table was originally introduced when Anki hashed media filenames,
and needed a way to remember the original filename. It also helped with:
1) getting a quick list of all media used in the deck, or the media added
   since the last sync, for mobile clients
2) merging identical files with different names

But had some drawbacks:
- every operation that modifies templates, models or facts meant generating
  the q/a and checking if any new media had appeared
- each entry is about 70 bytes, and some decks have 100k+ media files

So we remove the media table. We address 1) by being more intelligent about
media downloads on the mobile platform. We ask the user after a full sync if
they want to look for missing media, and they can choose not to if they know
they haven't added any. And on a partial sync, we can scan the contents of the
incoming facts for media references, and download any references we find. This
also avoids all the issues people had with media not downloading because it
was in their media folder but not in the media database.

For 2), when copying media to the media folder, if we have a duplicate
filename, we check if that file has the same md5, and avoid copying if so.
This won't merge identical content that has separate names, but instances
where users need that are rare.
2011-04-28 09:23:56 +09:00
..
importing remove progress handling code; we'll do it in the GUI or provide cb 2011-04-28 09:23:55 +09:00
template disable callable replacement which isn't supported on older pythons 2011-01-20 05:32:30 +09:00
__init__.py minor tweaks to doc 2011-04-28 09:23:55 +09:00
cards.py give card types a more logical order 2011-04-28 09:23:56 +09:00
consts.py implement sort fields; make sure they're updated on upgrade 2011-04-28 09:23:54 +09:00
cram.py implement cram 2011-04-28 09:23:56 +09:00
db.py speed up the revlog migration, tweak db handling 2011-04-28 09:23:55 +09:00
deck.py remove the media table 2011-04-28 09:23:56 +09:00
errors.py drop sqlalchemy; massive refactor 2011-04-28 09:23:53 +09:00
exporting.py remove progress handling code; we'll do it in the GUI or provide cb 2011-04-28 09:23:55 +09:00
facts.py implement new review code, add unit tests 2011-04-28 09:23:56 +09:00
find.py set the new types on upgrade 2011-04-28 09:23:56 +09:00
graphs.py drop sqlalchemy; massive refactor 2011-04-28 09:23:53 +09:00
groups.py implement cram 2011-04-28 09:23:56 +09:00
hooks.py minor tweaks to doc 2011-04-28 09:23:55 +09:00
lang.py remove self explanatory module docstrings; strip trailing whitespace 2011-04-28 09:21:07 +09:00
latex.py remove the media table 2011-04-28 09:23:56 +09:00
media.py remove the media table 2011-04-28 09:23:56 +09:00
models.py parse tags when creating fact, add selective study, fix emptyAns default 2011-04-28 09:23:55 +09:00
sched.py implement cram 2011-04-28 09:23:56 +09:00
sound.py remove some unused hooks 2011-04-28 09:23:55 +09:00
stats.py update finished msg 2011-04-28 09:23:56 +09:00
stdmodels.py convert templates to a json object, and replace tid with ord 2011-04-28 09:23:54 +09:00
storage.py remove the media table 2011-04-28 09:23:56 +09:00
sync.py remove q/a cache, tags in fields, rewrite remaining ids, more 2011-04-28 09:23:53 +09:00
utils.py implement new review code, add unit tests 2011-04-28 09:23:56 +09:00