mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 08:18:00 +01:00
move the single folder visibility check a bit further in the process
This commit is contained in:
parent
6d059ad426
commit
f38981be7b
1 changed files with 7 additions and 6 deletions
|
@ -61,7 +61,12 @@ class MediaFetcher(val context: Context) {
|
||||||
val selectionArgs = getSelectionArgsQuery(filterMedia).toTypedArray()
|
val selectionArgs = getSelectionArgsQuery(filterMedia).toTypedArray()
|
||||||
val cursor = context.contentResolver.query(uri, projection, selection, selectionArgs, null)
|
val cursor = context.contentResolver.query(uri, projection, selection, selectionArgs, null)
|
||||||
folders.addAll(parseCursor(cursor!!))
|
folders.addAll(parseCursor(cursor!!))
|
||||||
folders.toMutableList() as ArrayList<String>
|
|
||||||
|
val config = context.config
|
||||||
|
val shouldShowHidden = config.shouldShowHidden
|
||||||
|
val excludedPaths = config.excludedFolders
|
||||||
|
val includedPaths = config.includedFolders
|
||||||
|
folders.filter { it.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden, context) }.toMutableList() as ArrayList<String>
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
ArrayList()
|
ArrayList()
|
||||||
}
|
}
|
||||||
|
@ -185,11 +190,7 @@ class MediaFetcher(val context: Context) {
|
||||||
addFolder(foldersToScan, it)
|
addFolder(foldersToScan, it)
|
||||||
}
|
}
|
||||||
|
|
||||||
val showHidden = config.shouldShowHidden
|
return foldersToScan.distinctBy { it.getDistinctPath() }.toMutableSet() as LinkedHashSet<String>
|
||||||
val excludedFolders = config.excludedFolders
|
|
||||||
|
|
||||||
return foldersToScan.distinctBy { it.getDistinctPath() }
|
|
||||||
.filter { it.shouldFolderBeVisible(excludedFolders, includedFolders, showHidden, context) }.toMutableSet() as LinkedHashSet<String>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addFolder(curFolders: HashSet<String>, folder: String) {
|
private fun addFolder(curFolders: HashSet<String>, folder: String) {
|
||||||
|
|
Loading…
Reference in a new issue