You are on page 1of 6

11/30/2016 mediafolderswith12k+filesnotsupportedIssue#2060ankidroid/AnkiAndroidGitHub

Personal Open source Business Explore Pricing Blog Support This repository Search Sign in Sign up

ankidroid / Anki-Android Watch 77 Star 729 Fork 463

Code Issues 294 Pull requests 7 Projects 0 Wiki Pulse Graphs

media folders with 12k+ files not supported #2060 New issue

Open hssm opened this issue on Jul 28, 2015 32 comments

hssm commented on Jul 28, 2015 Member

Originally reported on Google Code with ID 1158

AsreportedontheAnkiforums,iftheinternalmemoryorSDcardareonaVFATpartition,
there'salimitofabout12kfilesinafolder,andattemptstowritemorethanthat
manyfilesfail.MostdesktopusersareonNTFS/HFS+/EXT3+whichallscaletothat
manyfilesfine,andasiOSalsousesHFS+,thisissueseemstobelimitedtoolddesktops
onVFATandAnkiDroid.

Perhapstheeasiestsolutionistoprovideanoptiontosavethefilesinazipand
extractthemwhenthey'refirstreferencedonacard,leavingthemthere.Thatwould
minimizeextrawritescomparedtoremovingthemafteracardisdisplayed.Storing
theminlotsofsubfoldersseemsamuchmorecomplicatedsolution:youwouldn'tbe
abletorelyonthehtml<base>tagformediaanylonger,anditwouldmakeitconsiderably
harderforuserstoknowwhichfoldermediaislocatedin.

Forumthreadforreference:https://groups.google.com/forum/?fromgroups#!topic/ankisrs/vrvELhL5V4M

Reported by dae@ichi2.net on 20120604 06:18:35

hssm commented on Jul 28, 2015 Member

ThankyouDamien,

IactuallymadeamistakewhenIsaid~12kfiles;itwasactuallycloserto~20kfiles
andstronglydependentonthelengthofthefilenames.

Thatworkaroundseemslikeitcouldbeagreatsolution!

Reported by perceptualChaos on 20120604 06:28:02

ankidroid was assigned by hssm on Jul 28, 2015

hssm added Type-Defect Priority-Medium open DevelopmentVersion labels on Jul 28, 2015

hssm commented on Jul 28, 2015 Member

Reported by nicolas.raoul on 20120604 09:13:43

Status changed: Accepted


Labels added: PriorityMedium
Labels removed: PriorityUndecided

hssm commented on Jul 28, 2015 Member

Reported by inigo.aldana on 20120724 13:42:08

Labels added: DevelopmentVersion

hssm commented on Jul 28, 2015 Member

Thanksforthis.PerhapsanotherworkaroundwouldbefunctioninAnkitorenamethe
mediafilestoshorterfilenames.

Reported by intercept.x.attack on 20120812 20:16:37

hssm commented on Jul 28, 2015 Member

https://github.com/ankidroid/AnkiAndroid/issues/2060 1/6
11/30/2016 mediafolderswith12k+filesnotsupportedIssue#2060ankidroid/AnkiAndroidGitHub

Alsoseethisthread:
https://groups.google.com/forum/?fromgroups#!topic/ankiandroid/tI_FTtbAqas%5B125%5D

Asperlinkinabovethread,renamingtoshorterfileswouldincreaselimitto65,536
whichismorethanIcurrentlyhaveinmycollection.mediafolder(50,000)butothers
mayhaveevenmore.Additionallythezipfilesolutionhastheadvantagethatit's
MUCHfastertocopythemediafilestothephonewithUSB2.Asperabove,anotherworkaround
(requiresrootandexternalSDslot)istoformatyourSDcardasNTFSorEXT4.

Reported by perceptualchaos2 on 20120812 22:00:31

hssm commented on Jul 28, 2015 Member

>>Asperabove,anotherworkaround(requiresrootandexternalSDslot)istoformat
yourSDcardasNTFSorEXT4.

Justdidthisanditworked.Besidesroot,youalsoneedanapptomountthecardas
bydefaultAndroidwilljustsayit'sanunsupportedformat.TheappiscalledNtfsSD
andit'sfreeinthePlayStore.

Thanksforyourhelp!

Reported by intercept.x.attack on 20120812 23:34:39

hssm commented on Jul 28, 2015 Member

Issue1480hasbeenmergedintothisissue.

Reported by inigo.aldana on 20121119 09:02:34

hssm commented on Jul 28, 2015 Member

OnepossibleoptionthathasnotbeenmentionedyetisExFAT,whichissupportedout
oftheboxonsomedevices.

Reported by dae@ichi2.net on 20121119 09:07:17

hssm commented on Jul 28, 2015 Member

Issue1469hasbeenmergedintothisissue.

Reported by perceptualchaos2 on 20130109 06:39:44

hssm commented on Jul 28, 2015 Member

Whataboutmountingthearchivelikee.g.ubuntudoes?So,leavethemp3inthearchive
(zip,tar.gzetc)andaccessthefilesthatway.Peter.

Reported by wave.root on 20130112 13:47:36

hssm commented on Jul 28, 2015 Member

Ifthere'sanysolutionthenit'dbegoodbecauseI'mnotsotechsavvyandrooting
isjustbeyondthescopeofmyability:(

Reported by kondeeza.123 on 20130113 08:21:53


Projects

None yet
hssm commented on Jul 28, 2015 Member

Labels

Issue1597hasbeenmergedintothisissue.
accepted

bug
Reported by inigo.aldana on 20130113 19:53:43 Priority-Medium

Milestone
hssm commented on Jul 28, 2015 Member
No milestone

https://github.com/ankidroid/AnkiAndroid/issues/2060 2/6
11/30/2016 mediafolderswith12k+filesnotsupportedIssue#2060ankidroid/AnkiAndroidGitHub

Assignees
Anotherapproachcouldbetousesubfoldersandsortthefilesintothosebyveryspecific
rules. ankidroid

Mediawikidoesthis,whenyoulookatafullsizeimageonWikipedia,youhavesomething
like"/X/XY/"intheURL/pathwithtwohexdigitsXandY. 4 participants

Iamnotsureabouttherules,probablysomekindofhashonthefilename.

Reported by ospalh on 20130115 11:07:58

hssm commented on Jul 28, 2015 Member

IsittruethatthisissueisonlyrelevantforVFATfilesystems?

Reported by inigo.aldana on 20130115 11:13:55

hssm commented on Jul 28, 2015 Member

>IsittruethatthisissueisonlyrelevantforVFATfilesystems?

Yes,onlyFAThasthisverylowlimit.

Butitriedandcouldn'tgetanythingelsetowork.

(Mightberelatedtothefactthatit'sacheapnonamemodel...)

Reported by ospalh on 20130115 13:15:07

hssm commented on Jul 28, 2015 Member

IfyouuseanexternalSDcardthenNTFSisconfirmedtobeworking.It
shouldalsobepossibletoformattheinternalSDcardaseitherNTFSor
EXT3/4withabitmorework,thoughIdon'tthinkanyonehereasreported
doingthisyet.

Reported by perceptualchaos2 on 20130115 13:21:39

hssm commented on Jul 28, 2015 Member

Oh.
Ihadtriedthe"NtFSMounter",*that*din'twork.

Nowitried"ParagonNTFS",lookslikethatworks.Soi'mjustnowcopyingatonof
mediafiles.:)

Reported by ospalh on 20130115 13:48:15

hssm commented on Jul 28, 2015 Member

CanwegetarealsolutiontothisproblemwithinAnkiDroid'scode?Nestedfoldersas
suggestedby#13wouldbeperfect.MediazipsassuggestedbyDamienwouldbeideal
fortransferspeeds.

AfterupdatingtoJB,Ican'tmountNTFSorEXT3/4anymore.WhichreallysucksasI
hitthefilecountlimitwaytooeasily.ManagingwhichmediafilesIneedforthe
weekisnearlyimpossible.

SinceitseemslikeNTFSisnogoformeunlessIjumpbacktoICS,isthereanygood
workaroundsforthis?Likeascripttosortoutallthemediaoncardsthatwillbe
duewithinthenextweek,and/orascripttorenameallthemediatoshorterfilenames?

Reported by daichi09 on 20130322 21:05:45


Projects

None yet

hssm commented on Jul 28, 2015 Member


Labels

accepted
Itshouldn'tbetoohardtomakeanaddonforAnkiDesktopwhichsplitsthemediafiles
intosubfoldersandupdatesthepathaccordinglyoneachofthenotes.Ithinkitshould bug
workoutoftheboxonAnkiDroid.
Priority-Medium
Youcouldtrygivingitagoyourself...orsomeoneheremayhavealreadymadeone;
IthinkHoussamisdoingthis.
Milestone

No milestone
Reported by perceptualchaos2 on 20130323 01:53:32

https://github.com/ankidroid/AnkiAndroid/issues/2060 3/6
11/30/2016 mediafolderswith12k+filesnotsupportedIssue#2060ankidroid/AnkiAndroidGitHub

Assignees

hssm commented on Jul 28, 2015 Member ankidroid

4 participants
No,I'mnotworkingonanaddon.Imanuallymovedfilesintosubfolders.Istillhad
theminseparatefoldersfrombeforetheupgrade,soitwaseasytotellwhichfiles
belongedtowhichdeck.Thenitwassimplyamatterofchangingmytemplatetohave
<imgsrc="mySubFolder/{{imgfield}}"/>

Ifyourimagefieldalreadyhasthe<img>tagsinit,youwillneedtoremovethem
withthesearchandreplacefeatureinAnki'sbrowser.Itsupportsregex,andtheexample
inthemanualisexactlylikethiscase,soyoucancopyit.OneproblemIraninto
withthat:myfieldswereusingdoublequotes(src="asdf.gif")butAnkiwasshowing
themwithsinglequotes(src='asdf.gif')intheHTMLeditor(ctrl+shift+x),sothe
regexdidn'tworkuntilIfiguredthatoutandchangedthequotestyle.

Reported by Houssam.Salem.Au on 20130323 03:53:44

hssm commented on Jul 28, 2015 Member

AhIsee,thanksfortheclarification.Itsoundsverystraightforward;maybeI'lladd
ittotheFAQ.

Reported by perceptualchaos2 on 20130323 04:38:14

hssm commented on Jul 28, 2015 Member

#19daichi09:
>(...I)sthereanygoodworkaroundsforthis?Like(...)ascripttorenameall>
themediatoshorterfilenames?

Well,itisverymuchnota*good*workaround,asatthemomentitgives*longer*file
names,butmaybemyDehasihlatoraddonattemptcouldbeusedasastartingpoint.
Itdoesgothroughthecollectionandrenamesmediafilesandchangesthecardsto
usethenewfilenames.
Itworksreasonablywellwhenyouonlyhaveoneimageorvideoineachfieldanduse
eachimage/videoononlyonenote.Ifthatisnotthecaseyourcollectionmay(or
maynot)endupinamess.(Itworkedwellenoughforme,soijustleftittherenot
reallyfinishedaftermycollectionwasdone.)

Ofcoursetobeasolutiontothisproblem,youwouldhavetochangethebitsthat
returnthenewfilenameandthosethatdeterminewhatcountsas"problem"files.

Seehttp://ospalh.github.com/ankiaddons/Dehashilator.html

Imentioned(#13)thewayMediawikiusessubfolderslike"4/41/asdf.gif".
Seehttp://www.mediawiki.org/wiki/Manual:$wgHashedUploadDirectorytheyuseMD5hashes
ofthefilename.

Reported by ospalh on 20130323 07:53:50

hssm commented on Jul 28, 2015 Member

Issue1830hasbeenmergedintothisissue.

Reported by Houssam.Salem.Au on 20130926 08:28:34

hssm commented on Jul 28, 2015 Member

Actuallywhat'saretheissuespreventingAnkiDroidfromfullysupportingsubfolders?

AsfarasIcanseewithmyowndecksitworksfine.Ihaveorganizedmyfilesinto
subfoldersrecentlybecausehaving50koftheminabigheapiscumbersomeevenwith
agoodfilesystem.IseethatAnkidesktophassomeminorproblemswiththat(it's
droppingfilesalwaysinthemainfolderandnotseeingfilesinsubfolderswhenI
use"CheckMedia")butnothingserious.Itsurelybeatshavingthetabletslowdown
whencopyingorrefusetoacceptsomefilesoverFTPformysteriousreasonswhenthey're
Projects
alltogetherorMTPhangfilemanagerwhenthefolderhastoomanyentries...Sowhy
not? None yet

Reported by cameel2 on 20150116 03:23:24 Labels

accepted

bug
hssm commented on Jul 28, 2015 Member
Priority-Medium

Export/Importdoesn'tworkwithsubfolders,and"fullysupporting"means Milestone
thatwewouldtryourbestnottomakeanychangeswhichbreaksubfolders,
whichisn'tsomethingwe'dwanttodo. No milestone

https://github.com/ankidroid/AnkiAndroid/issues/2060 4/6
11/30/2016 mediafolderswith12k+filesnotsupportedIssue#2060ankidroid/AnkiAndroidGitHub
Reported by perceptualchaos2 on 20150116 05:57:21 Assignees

ankidroid

hssm commented on Jul 28, 2015 Member


4 participants

Istherestillnofixforthisproblemasidefromneedingtoreformatasaworkaround?

Reported by leoraphael7@yahoo.com on 20150727 09:30:04

hssm commented on Jul 28, 2015 Member

ImnotsurebutpersonallyIhaventhadanissuewithsynchstaking30
minutesinmonths,beforeitusedtobeanalmostdailyoccurence.I
figuredsomethinghadhappenedbehindthescenestofixit.Goodluck
fixingyourissue.
27lip201511:30<ankidroid@googlecode.com>napisa(a):

Reported by jakubwalenczak on 20150727 09:38:15

jytou commented on Jan 30

My main problem is still with Android's media android.process.media process taking loads of time in the
media directory and eating up the CPU/battery all the time. So even if I understand that dumping all the
media in a single directory may be convenient for the anki developers, I find it poor practice. And I'm a
computer engineer, not a "noncomputerfriendly" person. It definitely would be best to find another option
for this. Either SQL database, either subfolders which would still not 100% fix the process.media problem,
but would somehow be better than only one directory. I consider moving all my media to a web server
rather than having to have to duplicate them on all my devices. I understand that this would break the
"check media" paradigm, but that can be done differently with a plugin.

timrae commented on Jan 30 Member

Are you using an external sd card?


On 31/01/2016 3:05 am, "jytou" notifications@github.com wrote:

My main problem is still with Android's media android.process.media


process taking loads of time in the media directory and eating up the
CPU/battery all the time. So even if I understand that dumping all the
media in a single directory may be convenient for the anki developers, I
find it poor practice. And I'm a computer engineer, not a
"noncomputerfriendly" person. It definitely would be best to find another
option for this. Either SQL database, either subfolders which would still
not 100% fix the process.media problem, but would somehow be better than
only one directory. I consider moving all my media to a web server rather
than having to have to duplicate them on all my devices. I understand that
this would break the "check media" paradigm, but that can be done
differently with a plugin.


Reply to this email directly or view it on GitHub
#2060 comment
.

jytou commented on Jan 30

Yes but at the beginning, I wasn't in the end it doesn't change a thing. I also tried adding a dot at the
beginning of the folder name some claim that this would "lure" the media scanner into thinking it's a
system folder and thus not scan it, but it still gets in it, as well as the regular ".nomedia" file, to no avail.
Note that my tablet is not that new, it's a Galaxy Tab 2 10.1, Android 4.1.2. And no I don't plan upgrading it.

jytou commented on Jan 30

Projects
... and just letting you know that beside this media library problem, Anki is a wonderful piece of software. :
None yet

Labels
timrae commented on Jan 30 Member
accepted

I had the same problem with my galaxy S2. I don't have either of the 12k bug
limit or the scanning issues after upgrading to an Xperia, which has a
Priority-Medium
decent internal filesystem.

As far as I'm concerned, they're both legacy issues that can be fixed by Milestone
upgrading to a newer device, so I don't feel it's worthwhile for us to make
No milestone

https://github.com/ankidroid/AnkiAndroid/issues/2060 5/6
11/30/2016 mediafolderswith12k+filesnotsupportedIssue#2060ankidroid/AnkiAndroidGitHub
any big architectural changes. Assignees
On 31/01/2016 8:58 am, "jytou" notifications@github.com wrote:
ankidroid

Yes but at the beginning, I wasn't in the end it doesn't change a


thing. I also tried adding a dot at the beginning of the folder name some 4 participants
claim that this would "lure" the media scanner into thinking it's a system
folder and thus not scan it, but it still gets in it, as well as the
regular ".nomedia" file, to no avail.
Note that my tablet is not that new, it's a Galaxy Tab 2 10.1, Android
4.1.2. And no I don't plan upgrading it.


Reply to this email directly or view it on GitHub
#2060 comment
.

hssm removed the DevelopmentVersion label on Jan 30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2016 GitHub, Inc. Terms Privacy Security Status Help Contact GitHub API Training Shop Blog About

Projects

None yet

Labels

accepted

bug

Priority-Medium

Milestone

No milestone

https://github.com/ankidroid/AnkiAndroid/issues/2060 6/6

You might also like