music: check compilation flag value
Only map compilation flags if the value is "1".
This commit is contained in:
parent
e50bc80a0b
commit
245896e4a7
2 changed files with 6 additions and 1 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
## dev
|
## dev
|
||||||
|
|
||||||
|
#### What's New
|
||||||
|
- Added support for `COMPILATION` and `ITUNESCOMPILATION` flags.
|
||||||
|
|
||||||
#### What's Improved
|
#### What's Improved
|
||||||
- Accept `REPLAYGAIN_*` adjustment information on OPUS files alongside
|
- Accept `REPLAYGAIN_*` adjustment information on OPUS files alongside
|
||||||
`R128_*` adjustments.
|
`R128_*` adjustments.
|
||||||
|
|
|
@ -159,7 +159,8 @@ private constructor(private val rawSong: RawSong, private val future: Future<Tra
|
||||||
textFrames["TCON"]?.let { rawSong.genreNames = it }
|
textFrames["TCON"]?.let { rawSong.genreNames = it }
|
||||||
|
|
||||||
// Compilation Flag
|
// 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.albumArtistNames = rawSong.albumArtistNames.ifEmpty { COMPILATION_ALBUM_ARTISTS }
|
||||||
rawSong.releaseTypes = rawSong.releaseTypes.ifEmpty { COMPILATION_RELEASE_TYPES }
|
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
|
// Compilation Flag
|
||||||
(comments["compilation"] ?: comments["itunescompilation"])?.let {
|
(comments["compilation"] ?: comments["itunescompilation"])?.let {
|
||||||
|
if (it.size != 1 || it[0] != "1") return@let
|
||||||
rawSong.albumArtistNames = rawSong.albumArtistNames.ifEmpty { COMPILATION_ALBUM_ARTISTS }
|
rawSong.albumArtistNames = rawSong.albumArtistNames.ifEmpty { COMPILATION_ALBUM_ARTISTS }
|
||||||
rawSong.releaseTypes = rawSong.releaseTypes.ifEmpty { COMPILATION_RELEASE_TYPES }
|
rawSong.releaseTypes = rawSong.releaseTypes.ifEmpty { COMPILATION_RELEASE_TYPES }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue