optimize folder fetching a bit

This commit is contained in:
tibbi 2019-02-27 18:52:54 +01:00
parent 60b6af17f8
commit 1daa85e629

View file

@ -125,9 +125,9 @@ class MediaFetcher(val context: Context) {
cursor.use {
if (cursor.moveToFirst()) {
do {
val path = cursor.getStringValue(MediaStore.Images.Media.DATA).trim()
val path = cursor.getStringValue(MediaStore.Images.Media.DATA)
val parentPath = File(path).parent?.trimEnd('/') ?: continue
if (!includedFolders.contains(parentPath) && !foldersToIgnore.contains(parentPath.toLowerCase())) {
if (!includedFolders.contains(parentPath) && !foldersToIgnore.contains(parentPath)) {
foldersToScan.add(parentPath)
}
} while (cursor.moveToNext())