musikr: fix build issues
This commit is contained in:
parent
10eb0be7d0
commit
be270a422b
2 changed files with 6 additions and 4 deletions
|
@ -76,18 +76,19 @@ private class DeviceFilesImpl(private val contentResolver: ContentResolver) : De
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
val childId = cursor.getString(childUriIndex)
|
val childId = cursor.getString(childUriIndex)
|
||||||
val displayName = cursor.getString(displayNameIndex)
|
val displayName = cursor.getString(displayNameIndex)
|
||||||
|
|
||||||
// Skip hidden files/directories if ignoreHidden is true
|
// Skip hidden files/directories if ignoreHidden is true
|
||||||
if (ignoreHidden && displayName.startsWith(".")) {
|
if (ignoreHidden && displayName.startsWith(".")) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
val newPath = relativePath.file(displayName)
|
val newPath = relativePath.file(displayName)
|
||||||
val mimeType = cursor.getString(mimeTypeIndex)
|
val mimeType = cursor.getString(mimeTypeIndex)
|
||||||
if (mimeType == DocumentsContract.Document.MIME_TYPE_DIR) {
|
if (mimeType == DocumentsContract.Document.MIME_TYPE_DIR) {
|
||||||
// This does NOT block the current coroutine. Instead, we will
|
// This does NOT block the current coroutine. Instead, we will
|
||||||
// evaluate this flow in parallel later to maximize throughput.
|
// 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") {
|
} else if (mimeType.startsWith("audio/") && mimeType != "audio/x-mpegurl") {
|
||||||
// Immediately emit all files given that it's just an O(1) op.
|
// 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
|
// This also just makes sure the outer flow has a reason to exist
|
||||||
|
|
|
@ -68,7 +68,8 @@ private class TagInterpreterImpl(private val interpretation: Interpretation) : T
|
||||||
val songNameOrFileWithoutExt =
|
val songNameOrFileWithoutExt =
|
||||||
song.tags.name ?: requireNotNull(song.file.path.name).split('.').first()
|
song.tags.name ?: requireNotNull(song.file.path.name).split('.').first()
|
||||||
val songNameOrFileWithoutExtCorrect =
|
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 albumNameOrDir = song.tags.albumName ?: song.file.path.directory.name
|
||||||
|
|
||||||
val musicBrainzId = song.tags.musicBrainzId?.toUuidOrNull()
|
val musicBrainzId = song.tags.musicBrainzId?.toUuidOrNull()
|
||||||
|
|
Loading…
Reference in a new issue