| Issue 1158: | media folders with 12k+ files not supported | |
| 17 people starred this issue and may be notified of changes. | Back to list |
As reported on the Anki forums, if the internal memory or SD card are on a VFAT partition, there's a limit of about 12k files in a folder, and attempts to write more than that many files fail. Most desktop users are on NTFS/HFS+/EXT3+ which all scale to that many files fine, and as iOS also uses HFS+, this issue seems to be limited to old desktops on VFAT and AnkiDroid. Perhaps the easiest solution is to provide an option to save the files in a zip and extract them when they're first referenced on a card, leaving them there. That would minimize extra writes compared to removing them after a card is displayed. Storing them in lots of subfolders seems a much more complicated solution: you wouldn't be able to rely on the html <base> tag for media any longer, and it would make it considerably harder for users to know which folder media is located in. Forum thread for reference: https://groups.google.com/forum/?fromgroups#!topic/ankisrs/vrvELhL5V4M
Jun 3, 2012
#1
perceptu...@gmail.com
Jun 4, 2012
(No comment was entered for this change.)
Status:
Accepted
Labels: -Priority-Undecided Priority-Medium
Jul 24, 2012
(No comment was entered for this change.)
Labels:
DevelopmentVersion
Aug 12, 2012
Thanks for this. Perhaps another workaround would be function in Anki to rename the media files to shorter file names.
Aug 12, 2012
Also see this thread: https://groups.google.com/forum/?fromgroups#!topic/anki-android/tI_FTtbAqas%5B1-25%5D As per link in above thread, renaming to shorter files would increase limit to 65,536 which is more than I currently have in my collection.media folder (50,000) but others may have even more. Additionally the zip file solution has the advantage that it's MUCH faster to copy the media files to the phone with USB2. As per above, another workaround (requires root and external SD slot) is to format your SD card as NTFS or EXT4.
Aug 12, 2012
>>As per above, another workaround (requires root and external SD slot) is to format your SD card as NTFS or EXT4. Just did this and it worked. Besides root, you also need an app to mount the card as by default Android will just say it's an unsupported format. The app is called NtfsSD and it's free in the Play Store. Thanks for your help!
Nov 19, 2012
Issue 1480 has been merged into this issue.
Nov 19, 2012
One possible option that has not been mentioned yet is ExFAT, which is supported out of the box on some devices.
Jan 8, 2013
Issue 1469 has been merged into this issue.
Jan 12, 2013
What about mounting the archive like e.g. ubuntu does? So, leave the mp3 in the archive (zip, tar.gz etc) and access the files that way. Peter.
Jan 13, 2013
If there's any solution then it'd be good because I'm not so tech savvy and rooting is just beyond the scope of my ability :(
Jan 13, 2013
Issue 1597 has been merged into this issue.
Jan 15, 2013
Another approach could be to use sub-folders and sort the files into those by very specific rules. Mediawiki does this, when you look at a full-size image on Wikipedia, you have something like "/X/XY/" in the URL/path with two hex digits X and Y. I am not sure about the rules, probably some kind of hash on the file name.
Jan 15, 2013
Is it true that this issue is only relevant for VFAT file systems?
Jan 15, 2013
>Is it true that this issue is only relevant for VFAT file systems? Yes, only FAT has this very low limit. But i tried and couldn't get anything else to work. (Might be related to the fact that it's a cheap no-name model...)
Jan 15, 2013
If you use an external SD card then NTFS is confirmed to be working. It should also be possible to format the internal SD card as either NTFS or EXT3/4 with a bit more work, though I don't think anyone here as reported doing this yet.
Jan 15, 2013
Oh. I had tried the "NtFS Mounter", *that* din't work. Now i tried "Paragon NTFS", looks like that works. So i'm just now copying a ton of media files. :)
Mar 22, 2013
Can we get a real solution to this problem within AnkiDroid's code? Nested folders as suggested by #13 would be perfect. Media zips as suggested by Damien would be ideal for transfer speeds. After updating to JB, I can't mount NTFS or EXT3/4 anymore. Which really sucks as I hit the file count limit way too easily. Managing which media files I need for the week is nearly impossible. Since it seems like NTFS is no go for me unless I jump back to ICS, is there any good workarounds for this? Like a script to sort out all the media on cards that will be due within the next week, and/or a script to rename all the media to shorter filenames?
Mar 22, 2013
It shouldn't be too hard to make an add-on for Anki Desktop which splits the media files into subfolders and updates the path accordingly on each of the notes. I think it should work out of the box on AnkiDroid. You could try giving it a go yourself... or someone here may have already made one; I think Houssam is doing this.
Mar 22, 2013
No, I'm not working on an add-on. I manually moved files into subfolders. I still had them in separate folders from before the upgrade, so it was easy to tell which files belonged to which deck. Then it was simply a matter of changing my template to have <img src="mySubFolder/{{imgfield}}"/>
If your image field already has the <img> tags in it, you will need to remove them with the search and replace feature in Anki's browser. It supports regex, and the example in the manual is exactly like this case, so you can copy it. One problem I ran into with that: my fields were using double quotes (src="asdf.gif") but Anki was showing them with single quotes (src='asdf.gif') in the HTML editor (ctrl+shift+x), so the regex didn't work until I figured that out and changed the quote style.
Mar 22, 2013
Ah I see, thanks for the clarification. It sounds very straightforward; maybe I'll add it to the FAQ.
Mar 23, 2013
#19 daichi09: > (... I)s there any good workarounds for this? Like (...) a script to rename all > the media to shorter filenames? Well, it is very much not a *good* workaround, as at the moment it gives *longer* file names, but maybe my Dehasihlator add-on attempt could be used as a starting point. It does go through the collection and renames media files and changes the cards to use the new file names. It works reasonably well when you only have one image or video in each field and use each image/video on only one note. If that is not the case your collection may (or may not) end up in a mess. (It worked well enough for me, so i just left it there not really finished after my collection was done.) Of course to be a solution to this problem, you would have to change the bits that return the new file name and those that determine what counts as "problem" files. See http://ospalh.github.com/anki-addons/Dehashilator.html I mentioned (#13) the way Mediawiki uses subfolders like "4/41/asdf.gif". See http://www.mediawiki.org/wiki/Manual:$wgHashedUploadDirectory they use MD5 hashes of the file name.
Sep 26, 2013
Issue 1830 has been merged into this issue. |
|
| ► Sign in to add a comment |