From 6a0fd766362529f9b9f0bea674dd6f716d308da4 Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Tue, 9 Jan 2024 13:50:02 -0700 Subject: [PATCH] music: fix selector error with malformed folders Forgot that i is not a good indicator of if we need to begin a selector or not since we may discard certain music folders. --- .../org/oxycblt/auxio/music/fs/MediaStorePathInterpreter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/oxycblt/auxio/music/fs/MediaStorePathInterpreter.kt b/app/src/main/java/org/oxycblt/auxio/music/fs/MediaStorePathInterpreter.kt index 23e58c80d..8a9a4e1df 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/fs/MediaStorePathInterpreter.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/fs/MediaStorePathInterpreter.kt @@ -137,7 +137,7 @@ private constructor(private val cursor: Cursor, volumeManager: VolumeManager) : val path = paths[i] val volume = path.volume.components ?: continue template += - if (i == 0) { + if (args.isEmpty()) { "${MediaStore.Audio.AudioColumns.DATA} LIKE ?" } else { " OR ${MediaStore.Audio.AudioColumns.DATA} LIKE ?" @@ -217,7 +217,7 @@ private constructor(private val cursor: Cursor, volumeManager: VolumeManager) : for (i in paths.indices) { val path = paths[i] template = - if (i == 0) { + if (args.isEmpty()) { "(${MediaStore.Audio.AudioColumns.VOLUME_NAME} LIKE ? " + "AND ${MediaStore.Audio.AudioColumns.RELATIVE_PATH} LIKE ?)" } else {