Skip to content

Commit

Permalink
fix: whitelist & blacklist folders being ignored (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrouge committed Nov 10, 2024
1 parent 249552e commit 1a27695
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class MediaExposer(private val symphony: Symphony) {

private suspend fun scanMediaTree(cycle: ScanCycle, path: SimplePath, file: DocumentFileX) {
try {
if (!cycle.filter.isWhitelisted(file.name)) {
if (!cycle.filter.isWhitelisted(path.pathString)) {
return
}
coroutineScope {
Expand Down Expand Up @@ -222,12 +222,14 @@ class MediaExposer(private val symphony: Symphony) {
return false
}
}
val bFilter = blacklisted.findLast { x -> path.startsWith(x) }
val bFilter = blacklisted.findLast {
path.startsWith(it)
}
if (bFilter == null) {
return true
}
val wFilter = whitelisted.findLast { x ->
x.startsWith(bFilter) && path.startsWith(x)
val wFilter = whitelisted.findLast {
it.startsWith(bFilter) && path.startsWith(it)
}
return wFilter != null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fun SettingsMultiGrooveFolderTile(
explorer = explorer,
onSelect = {
if (it != null) {
val path = "/" + it.parts.subList(1, it.size).joinToString("/")
val path = SimplePath(it.parts.subList(1, it.size)).pathString
if (!values.contains(path)) {
values.add(path)
}
Expand Down

0 comments on commit 1a27695

Please sign in to comment.