mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
optimize folder fetching a bit
This commit is contained in:
parent
60b6af17f8
commit
1daa85e629
1 changed files with 2 additions and 2 deletions
|
@ -125,9 +125,9 @@ class MediaFetcher(val context: Context) {
|
||||||
cursor.use {
|
cursor.use {
|
||||||
if (cursor.moveToFirst()) {
|
if (cursor.moveToFirst()) {
|
||||||
do {
|
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
|
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)
|
foldersToScan.add(parentPath)
|
||||||
}
|
}
|
||||||
} while (cursor.moveToNext())
|
} while (cursor.moveToNext())
|
||||||
|
|
Loading…
Reference in a new issue