Interesting idea : collection.media folder performance

whenever i try to open up the media folder it takes about 20 seconds to load 600 images . im worried that in 10 years those 600 images will turn into 10 000 !!!

a solution is to make anki place those images in folders which contain a certain maximum number of images

so lets say make anki place a max of 30 images in a subfolder (call it subfolder 1 ) inside the collection.media directory

once subfolder 1 fills up, anki should create another subfolder in the collection.media directory. this time it’s called subfolder 2.

keep repeating.

by the end of this process, I should have 20 subfolders in the collection.media directory.

to solve the problem of having too many subfolders in the collection.media directory anki should recognize that there are too many, which will then prompt the action of creating sub-subfolder

collection.media directory

    subfolder1

        subfolder1

            subfolder1

            subfolder2

            subfolder3

            subfolder4

            subfolder5

            subfolder6

            subfolder7

            subfolder8

            subfolder9

            subfolder10

            subfolder11

            subfolder12

            subfolder13

            subfolder14

            subfolder15

            subfolder16

            subfolder17

            subfolder18

            subfolder19

            subfolder20

        subfolder2

        subfolder3

        subfolder4

        subfolder5

        subfolder6

        subfolder7

        subfolder8

        subfolder9

        subfolder10

        subfolder11

        subfolder12

        subfolder13

        subfolder14

        subfolder15

        subfolder16

        subfolder17

        subfolder18

        subfolder19

        subfolder20

    subfolder2

        subfolder1

        subfolder2

        subfolder3

        subfolder4

        subfolder5

        subfolder6

        subfolder7

        subfolder8

        subfolder9

        subfolder10

        subfolder11

        subfolder12

        subfolder13

        subfolder14

        subfolder15

        subfolder16

        subfolder17

        subfolder18

        subfolder19

        subfolder20

    subfolder3

    subfolder4

    subfolder5

    subfolder6

    subfolder7

    subfolder8

    subfolder9

    subfolder10

    subfolder11

    subfolder12

    subfolder13

    subfolder14

    subfolder15

    subfolder16

    subfolder17

    subfolder18

    subfolder19

    subfolder20

2 Likes

probs hard to implement but it vastly improved performance. i tried it manually

1 Like

What platform/OS? Most modern file systems accommodate huge amounts of files in in the same directory? It has to be something else.

Large folders only cause problems when you attempt to view a summary of their contents. Anki doesn’t do that, but you may do so if you’re browsing the files inside it. If your workflow involves reusing images across multiple cards, you can store your media files in a tree somewhere else on your computer, and select the files from there. If you select a file that is already in the media folder, Anki will not add a copy of it.

1 Like

To simplify file searching I suggest having the same amount of levels in all branches at any given moment and generating the subfolder names from the names of the files: so collection.media/hello.mp3 would become collection.media/h/e/hello.mp3 if we currently have 2 levels of subfolders.