avoid fetching locked folder items at Show All Folders Content

This commit is contained in:
tibbi 2019-07-02 20:15:49 +02:00
parent 9aea2eec63
commit 734db5f242
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickImage
val favoritePaths = context.getFavoritePaths()
val getVideoDurations = context.config.showThumbnailVideoDuration
val media = if (showAll) {
val foldersToScan = mediaFetcher.getFoldersToScan().filter { it != RECYCLE_BIN && it != FAVORITES }
val foldersToScan = mediaFetcher.getFoldersToScan().filter { it != RECYCLE_BIN && it != FAVORITES && !context.config.isFolderProtected(it) }
val media = ArrayList<Medium>()
foldersToScan.forEach {
val newMedia = mediaFetcher.getFilesFrom(it, isPickImage, isPickVideo, getProperDateTaken, getProperFileSize, favoritePaths, getVideoDurations, false)

View file

@ -616,7 +616,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
}
val shouldShowHidden = config.shouldShowHidden
foldersToScan.forEach {
foldersToScan.filter { path.isNotEmpty() || !config.isFolderProtected(it) }.forEach {
try {
val currMedia = mediumDao.getMediaFromPath(it)
media.addAll(currMedia)