music: check compilation flag value

Only map compilation flags if the value is "1".
This commit is contained in:
Alexander Capehart
2023-03-19 13:20:07 -06:00
parent e50bc80a0b
commit 245896e4a7
2 changed files with 6 additions and 1 deletions
@@ -159,7 +159,8 @@ private constructor(private val rawSong: RawSong, private val future: Future<Tra
textFrames["TCON"]?.let { rawSong.genreNames = it }
// Compilation Flag
(textFrames["TXXX:compilation"] ?: textFrames["TXXX:itunescompilation"])?.let {
(textFrames["TCMP"] ?: textFrames["TXXX:compilation"] ?: textFrames["TXXX:itunescompilation"])?.let {
if (it.size != 1 || it[0] != "1") return@let
rawSong.albumArtistNames = rawSong.albumArtistNames.ifEmpty { COMPILATION_ALBUM_ARTISTS }
rawSong.releaseTypes = rawSong.releaseTypes.ifEmpty { COMPILATION_RELEASE_TYPES }
}
@@ -266,6 +267,7 @@ private constructor(private val rawSong: RawSong, private val future: Future<Tra
// Compilation Flag
(comments["compilation"] ?: comments["itunescompilation"])?.let {
if (it.size != 1 || it[0] != "1") return@let
rawSong.albumArtistNames = rawSong.albumArtistNames.ifEmpty { COMPILATION_ALBUM_ARTISTS }
rawSong.releaseTypes = rawSong.releaseTypes.ifEmpty { COMPILATION_RELEASE_TYPES }
}