musikr: fix build issues

This commit is contained in:
Alexander Capehart 2025-02-25 16:00:18 -07:00
parent 10eb0be7d0
commit be270a422b
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 6 additions and 4 deletions

View file

@ -76,18 +76,19 @@ private class DeviceFilesImpl(private val contentResolver: ContentResolver) : De
while (cursor.moveToNext()) {
val childId = cursor.getString(childUriIndex)
val displayName = cursor.getString(displayNameIndex)
// Skip hidden files/directories if ignoreHidden is true
if (ignoreHidden && displayName.startsWith(".")) {
continue
}
val newPath = relativePath.file(displayName)
val mimeType = cursor.getString(mimeTypeIndex)
if (mimeType == DocumentsContract.Document.MIME_TYPE_DIR) {
// This does NOT block the current coroutine. Instead, we will
// evaluate this flow in parallel later to maximize throughput.
recursive.add(exploreImpl(contentResolver, rootUri, childId, newPath, ignoreHidden))
recursive.add(
exploreImpl(contentResolver, rootUri, childId, newPath, ignoreHidden))
} else if (mimeType.startsWith("audio/") && mimeType != "audio/x-mpegurl") {
// Immediately emit all files given that it's just an O(1) op.
// This also just makes sure the outer flow has a reason to exist

View file

@ -68,7 +68,8 @@ private class TagInterpreterImpl(private val interpretation: Interpretation) : T
val songNameOrFileWithoutExt =
song.tags.name ?: requireNotNull(song.file.path.name).split('.').first()
val songNameOrFileWithoutExtCorrect =
song.tags.name ?: requireNotNull(song.file.path.name).split('.').dropLast(1).joinToString('.')
song.tags.name
?: requireNotNull(song.file.path.name).split('.').dropLast(1).joinToString(".")
val albumNameOrDir = song.tags.albumName ?: song.file.path.directory.name
val musicBrainzId = song.tags.musicBrainzId?.toUuidOrNull()