Skip to content

Commit

Permalink
music: fix selector error with malformed folders
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
OxygenCobalt committed Jan 9, 2024
1 parent 5d5356e commit 6a0fd76
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6a0fd76

Please sign in to comment.