From the print statement in StorageProvider.kt
/tmp/junit3921508329320678908/custom1 | /tmp/xxxx/external-cache /tmp/junit3921508329320678908/custom1 | /tmp/junit3921508329320678908/custom1 /tmp/xxxx/external-cache/custom2 | /tmp/xxxx/external-cache // <-- the problematic one /tmp/xxxx/external-cache/custom2 | /tmp/junit3921508329320678908/custom1 /tmp/xxxx/external-cache/custom2 | /tmp/xxxx/external-cache/custom2
This line -
if (customDir.path.startsWith(mediaDirLocation)) continue@customLoop should imply that custom2 directory won't be considered since it starts with the mediaDirLocation in one place. However, down the iterations, eventually it stumbles upon
/tmp/junit3921508329320678908/custom1 in mediaDirLocation and so includes it. Is it an intentional behaviour? Since I assumed that the StorageProvider should skip stuff which would come in nested directory anyways..
I don't get it. What is in
customDirectoriesand what's not?
which folder are included in the end?
customDirectories is supposed to contain user-added directories to be scanned by medialibrary. And the getMediaDirectories method of DirectoryRepository also includes it.. Now, it's fetched again by StorageProvider in customDirectories and merged with storages in such a way that it only appears once in the storagesList.
However, I am confused about those custom directories which are children of already included directories in storages, like Internal Storage. What the logic implies is that they shouldn't be considered in storagesList. However, they actually are considered. So, I wanted to confirm is this intentional behavior?
airmore directory is inside Internal Storages. Internal Storages can be added as custom directory, however it shows in the list maximum of two times.