musikr: simplify fixed extension stripping

This commit is contained in:
Alexander Capehart 2025-03-04 12:22:00 -07:00
parent 6b8c0faf44
commit a2af205c71
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -69,7 +69,7 @@ private class TagInterpreterImpl(private val interpretation: Interpretation) : T
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 song.tags.name
?: requireNotNull(song.file.path.name).split('.').dropLast(1).joinToString(".") ?: requireNotNull(song.file.path.name).substringBeforeLast(".")
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()