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 cursor = context.contentResolver.query(uri, projection, selection, selectionArgs, null)
|
||||
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) {
|
||||
ArrayList()
|
||||
}
|
||||
|
@ -185,11 +190,7 @@ class MediaFetcher(val context: Context) {
|
|||
addFolder(foldersToScan, it)
|
||||
}
|
||||
|
||||
val showHidden = config.shouldShowHidden
|
||||
val excludedFolders = config.excludedFolders
|
||||
|
||||
return foldersToScan.distinctBy { it.getDistinctPath() }
|
||||
.filter { it.shouldFolderBeVisible(excludedFolders, includedFolders, showHidden, context) }.toMutableSet() as LinkedHashSet<String>
|
||||
return foldersToScan.distinctBy { it.getDistinctPath() }.toMutableSet() as LinkedHashSet<String>
|
||||
}
|
||||
|
||||
private fun addFolder(curFolders: HashSet<String>, folder: String) {
|
||||
|
|
Loading…
Reference in a new issue