Screen text: In media folder but not used by any cards: Tübingen_Neckarfront.jpg Used on cards but missing from media folder: Tübingen_Neckarfront.jpg.
So, the file is there and it is missing‽

This can be used to fix a problem caused by adding files sideways on Macs.

This add-on does not work with newer versions of Anki. On the other hand it should not be needed any more.

The problem

When files are added not with the file add dialog through the paper clip icon, but through other ways,

  • by copying them to the media folder by hand and adding the text to display them to the fields,
  • through other tools like older versions (up to version 2.3.4, 24 January 2013) of my Download audio add-on,
  • or possibly by drag-and-dropping them from the Finder,

there may be a problem caused by a quirk of the Macs’ file system. In file names on Macs, many non-ASCII characters are decomposed. For example, the character ü is stored as u plus the dots as an extra character.

Most of the time this is completely harmless. But when the text in the field contains an un-decomposed character, for example <img src="Tübingen_Neckarfront.jpg" /> and that text together with the file with the decomposed name, Tübingen_Neckarfront.jpg, are synced to a Linux or Windows machine, those two strings do not point to the same file. The result is that the file isn’t show during review. At the moment (January 2013, Anki 2.0.6), the Tools/Maintenance/Unused media… file will not detect this problem, it only becomes apparent during reviews or when browsing the cards.

The solution

The add-on goes through the collection and renames media file to those used in the collection when the on-disk name is the Mac OS X version of that in the collection.

This add-on in a hack. It worked well for me, but might introduce errors in the collection. Caveat emptor.

This can work only when run on non-Macs. When there is no non-Mac desktop client available, the only solution to this problem that i see is to go through the collection and fix the file names by hand. Or possibly re-download audio clips with a new version of Download audio, if that is what caused the problems.

See also

This issue has been discussed as one or possibly two issues at the Anki issue tracker.