music: parse singular spaced artist tags
On ID3 and Vorbis.
This commit is contained in:
parent
4a57d85037
commit
7a00c3c6aa
1 changed files with 37 additions and 31 deletions
|
@ -153,6 +153,7 @@ private class TagWorkerImpl(
|
|||
|
||||
private fun populateWithId3v2(textFrames: Map<String, List<String>>) {
|
||||
// Song
|
||||
logD(textFrames)
|
||||
(textFrames["TXXX:musicbrainz release track id"]
|
||||
?: textFrames["TXXX:musicbrainz_releasetrackid"])
|
||||
?.let { rawSong.musicBrainzId = it.first() }
|
||||
|
@ -200,10 +201,11 @@ private class TagWorkerImpl(
|
|||
(textFrames["TXXX:musicbrainz artist id"] ?: textFrames["TXXX:musicbrainz_artistid"])?.let {
|
||||
rawSong.artistMusicBrainzIds = it
|
||||
}
|
||||
(textFrames["TXXX:artists"] ?: textFrames["TPE1"])?.let { rawSong.artistNames = it }
|
||||
(textFrames["TXXX:artists"] ?: textFrames["TPE1"]
|
||||
?: textFrames["TXXX:artist"])?.let { rawSong.artistNames = it }
|
||||
(textFrames["TXXX:artistssort"]
|
||||
?: textFrames["TXXX:artists_sort"] ?: textFrames["TXXX:artists sort"]
|
||||
?: textFrames["TSOP"])
|
||||
?: textFrames["TSOP"] ?: textFrames["artistsort"] ?: textFrames["TXXX:artist sort"])
|
||||
?.let { rawSong.artistSortNames = it }
|
||||
|
||||
// Album artist
|
||||
|
@ -212,13 +214,14 @@ private class TagWorkerImpl(
|
|||
?.let { rawSong.albumArtistMusicBrainzIds = it }
|
||||
(textFrames["TXXX:albumartists"]
|
||||
?: textFrames["TXXX:album_artists"] ?: textFrames["TXXX:album artists"]
|
||||
?: textFrames["TPE2"])
|
||||
?: textFrames["TPE2"] ?: textFrames["TXXX:albumartist"]
|
||||
?: textFrames["TXXX:album artist"])
|
||||
?.let { rawSong.albumArtistNames = it }
|
||||
(textFrames["TXXX:albumartistssort"]
|
||||
?: textFrames["TXXX:albumartists_sort"] ?: textFrames["TXXX:albumartists sort"]
|
||||
?: textFrames["TXXX:albumartistsort"]
|
||||
// This is a non-standard iTunes extension
|
||||
?: textFrames["TSO2"])
|
||||
?: textFrames["TSO2"] ?: textFrames["TXXX:album artist sort"])
|
||||
?.let { rawSong.albumArtistSortNames = it }
|
||||
|
||||
// Genre
|
||||
|
@ -289,13 +292,15 @@ private class TagWorkerImpl(
|
|||
// Track.
|
||||
parseVorbisPositionField(
|
||||
comments["tracknumber"]?.first(),
|
||||
(comments["totaltracks"] ?: comments["tracktotal"] ?: comments["trackc"])?.first())
|
||||
(comments["totaltracks"] ?: comments["tracktotal"] ?: comments["trackc"])?.first()
|
||||
)
|
||||
?.let { rawSong.track = it }
|
||||
|
||||
// Disc and it's subtitle name.
|
||||
parseVorbisPositionField(
|
||||
comments["discnumber"]?.first(),
|
||||
(comments["totaldiscs"] ?: comments["disctotal"] ?: comments["discc"])?.first())
|
||||
(comments["totaldiscs"] ?: comments["disctotal"] ?: comments["discc"])?.first()
|
||||
)
|
||||
?.let { rawSong.disc = it }
|
||||
comments["discsubtitle"]?.let { rawSong.subtitle = it.first() }
|
||||
|
||||
|
@ -326,7 +331,8 @@ private class TagWorkerImpl(
|
|||
}
|
||||
(comments["artists"] ?: comments["artist"])?.let { rawSong.artistNames = it }
|
||||
(comments["artistssort"]
|
||||
?: comments["artists_sort"] ?: comments["artists sort"] ?: comments["artistsort"])
|
||||
?: comments["artists_sort"] ?: comments["artists sort"] ?: comments["artistsort"]
|
||||
?: comments["artist sort"])
|
||||
?.let { rawSong.artistSortNames = it }
|
||||
|
||||
// Album artist
|
||||
|
@ -335,11 +341,11 @@ private class TagWorkerImpl(
|
|||
}
|
||||
(comments["albumartists"]
|
||||
?: comments["album_artists"] ?: comments["album artists"]
|
||||
?: comments["albumartist"])
|
||||
?: comments["albumartist"] ?: comments["album artist"])
|
||||
?.let { rawSong.albumArtistNames = it }
|
||||
(comments["albumartistssort"]
|
||||
?: comments["albumartists_sort"] ?: comments["albumartists sort"]
|
||||
?: comments["albumartistsort"])
|
||||
?: comments["albumartistsort"] ?: comments["album artist sort"])
|
||||
?.let { rawSong.albumArtistSortNames = it }
|
||||
|
||||
// Genre
|
||||
|
|
Loading…
Reference in a new issue