removing a redundant argument

This commit is contained in:
tibbi 2020-09-09 23:04:33 +02:00
parent 59b1ee5e67
commit 68140085ff
3 changed files with 3 additions and 4 deletions

View file

@ -516,7 +516,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
val shouldShowHidden = config.shouldShowHidden || forceShowHidden
val excludedPaths = config.excludedFolders
val includedPaths = config.includedFolders
var filteredDirectories = directories.filter { it.path.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden, this) } as ArrayList<Directory>
var filteredDirectories = directories.filter { it.path.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden) } as ArrayList<Directory>
val filterMedia = config.filterMedia
filteredDirectories = (when {

View file

@ -1,6 +1,5 @@
package com.simplemobiletools.gallery.pro.extensions
import android.content.Context
import android.os.Environment
import com.simplemobiletools.commons.extensions.containsNoMedia
import com.simplemobiletools.commons.extensions.doesParentHaveNoMedia
@ -11,7 +10,7 @@ fun String.isThisOrParentIncluded(includedPaths: MutableSet<String>) = includedP
fun String.isThisOrParentExcluded(excludedPaths: MutableSet<String>) = excludedPaths.any { equals(it, true) } || excludedPaths.any { "$this/".startsWith("$it/", true) }
fun String.shouldFolderBeVisible(excludedPaths: MutableSet<String>, includedPaths: MutableSet<String>, showHidden: Boolean, context: Context): Boolean {
fun String.shouldFolderBeVisible(excludedPaths: MutableSet<String>, includedPaths: MutableSet<String>, showHidden: Boolean): Boolean {
if (isEmpty()) {
return false
}

View file

@ -67,7 +67,7 @@ class MediaFetcher(val context: Context) {
val excludedPaths = config.excludedFolders
val includedPaths = config.includedFolders
folders.distinctBy { it.getDistinctPath() }
.filter { it.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden, context) }.toMutableList() as ArrayList<String>
.filter { it.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden) }.toMutableList() as ArrayList<String>
} catch (e: Exception) {
ArrayList()
}