musikr.saf: fix exclusion

This commit is contained in:
Alexander Capehart
2025-07-04 13:44:35 -06:00
parent 4cbe4865a4
commit 34a8d162cb
@@ -55,7 +55,7 @@ private constructor(
DocumentsContract.getTreeDocumentId(location.uri), DocumentsContract.getTreeDocumentId(location.uri),
location.path, location.path,
null, null,
query.exclude.mapTo(mutableSetOf()) { it.uri }) query.exclude.mapTo(mutableSetOf()) { it.path })
} }
override fun track(): Flow<FSUpdate> = callbackFlow { override fun track(): Flow<FSUpdate> = callbackFlow {
@@ -77,7 +77,7 @@ private constructor(
treeDocumentId: String, treeDocumentId: String,
relativePath: Path, relativePath: Path,
parent: Deferred<Directory>?, parent: Deferred<Directory>?,
exclude: Set<Uri> exclude: Set<Path>
): Flow<File> = flow { ): Flow<File> = flow {
// Make a kotlin future // Make a kotlin future
val uri = DocumentsContract.buildChildDocumentsUriUsingTree(rootUri, treeDocumentId) val uri = DocumentsContract.buildChildDocumentsUriUsingTree(rootUri, treeDocumentId)
@@ -111,7 +111,7 @@ private constructor(
// We can check for direct equality as if we block out an excluded directory we // We can check for direct equality as if we block out an excluded directory we
// will by proxy block out it's children. // will by proxy block out it's children.
if (childUri in exclude) { if (newPath in exclude) {
continue continue
} }