mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-20 14:00:37 +01:00
avoid concurrent arraylist modification at portrait fetching
This commit is contained in:
parent
9f7afabc7f
commit
ff79038efa
@ -620,12 +620,14 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (config.filterMedia and TYPE_PORTRAITS != 0) {
|
if (config.filterMedia and TYPE_PORTRAITS != 0) {
|
||||||
|
val foldersToAdd = ArrayList<String>()
|
||||||
for (folder in foldersToScan) {
|
for (folder in foldersToScan) {
|
||||||
val allFiles = File(folder).listFiles() ?: continue
|
val allFiles = File(folder).listFiles() ?: continue
|
||||||
allFiles.filter { it.isDirectory && it.name.startsWith("img_", true) }.forEach {
|
allFiles.filter { it.isDirectory && it.name.startsWith("img_", true) }.forEach {
|
||||||
foldersToScan.add(it.absolutePath)
|
foldersToAdd.add(it.absolutePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foldersToScan.addAll(foldersToAdd)
|
||||||
}
|
}
|
||||||
|
|
||||||
val shouldShowHidden = config.shouldShowHidden
|
val shouldShowHidden = config.shouldShowHidden
|
||||||
|
Loading…
x
Reference in New Issue
Block a user