all: reformat
This commit is contained in:
parent
5c779f6d89
commit
aa140bebaa
2 changed files with 40 additions and 39 deletions
|
@ -70,7 +70,8 @@ sealed interface Name : Comparable<Name> {
|
||||||
final override fun compareTo(other: Name) =
|
final override fun compareTo(other: Name) =
|
||||||
when (other) {
|
when (other) {
|
||||||
is Known -> {
|
is Known -> {
|
||||||
val result = sortTokens.zip(other.sortTokens).fold(0) { acc, (token, otherToken) ->
|
val result =
|
||||||
|
sortTokens.zip(other.sortTokens).fold(0) { acc, (token, otherToken) ->
|
||||||
acc.takeIf { it != 0 } ?: token.compareTo(otherToken)
|
acc.takeIf { it != 0 } ?: token.compareTo(otherToken)
|
||||||
}
|
}
|
||||||
if (result != 0) result else sortTokens.size.compareTo(other.sortTokens.size)
|
if (result != 0) result else sortTokens.size.compareTo(other.sortTokens.size)
|
||||||
|
|
|
@ -201,11 +201,13 @@ private class TagWorkerImpl(
|
||||||
(textFrames["TXXX:musicbrainz artist id"] ?: textFrames["TXXX:musicbrainz_artistid"])?.let {
|
(textFrames["TXXX:musicbrainz artist id"] ?: textFrames["TXXX:musicbrainz_artistid"])?.let {
|
||||||
rawSong.artistMusicBrainzIds = it
|
rawSong.artistMusicBrainzIds = it
|
||||||
}
|
}
|
||||||
(textFrames["TXXX:artists"] ?: textFrames["TPE1"]
|
(textFrames["TXXX:artists"] ?: textFrames["TPE1"] ?: textFrames["TXXX:artist"])?.let {
|
||||||
?: textFrames["TXXX:artist"])?.let { rawSong.artistNames = it }
|
rawSong.artistNames = it
|
||||||
|
}
|
||||||
(textFrames["TXXX:artistssort"]
|
(textFrames["TXXX:artistssort"]
|
||||||
?: textFrames["TXXX:artists_sort"] ?: textFrames["TXXX:artists sort"]
|
?: textFrames["TXXX:artists_sort"] ?: textFrames["TXXX:artists sort"]
|
||||||
?: textFrames["TSOP"] ?: textFrames["artistsort"] ?: textFrames["TXXX:artist sort"])
|
?: textFrames["TSOP"] ?: textFrames["artistsort"]
|
||||||
|
?: textFrames["TXXX:artist sort"])
|
||||||
?.let { rawSong.artistSortNames = it }
|
?.let { rawSong.artistSortNames = it }
|
||||||
|
|
||||||
// Album artist
|
// Album artist
|
||||||
|
@ -292,15 +294,13 @@ private class TagWorkerImpl(
|
||||||
// Track.
|
// Track.
|
||||||
parseVorbisPositionField(
|
parseVorbisPositionField(
|
||||||
comments["tracknumber"]?.first(),
|
comments["tracknumber"]?.first(),
|
||||||
(comments["totaltracks"] ?: comments["tracktotal"] ?: comments["trackc"])?.first()
|
(comments["totaltracks"] ?: comments["tracktotal"] ?: comments["trackc"])?.first())
|
||||||
)
|
|
||||||
?.let { rawSong.track = it }
|
?.let { rawSong.track = it }
|
||||||
|
|
||||||
// Disc and it's subtitle name.
|
// Disc and it's subtitle name.
|
||||||
parseVorbisPositionField(
|
parseVorbisPositionField(
|
||||||
comments["discnumber"]?.first(),
|
comments["discnumber"]?.first(),
|
||||||
(comments["totaldiscs"] ?: comments["disctotal"] ?: comments["discc"])?.first()
|
(comments["totaldiscs"] ?: comments["disctotal"] ?: comments["discc"])?.first())
|
||||||
)
|
|
||||||
?.let { rawSong.disc = it }
|
?.let { rawSong.disc = it }
|
||||||
comments["discsubtitle"]?.let { rawSong.subtitle = it.first() }
|
comments["discsubtitle"]?.let { rawSong.subtitle = it.first() }
|
||||||
|
|
||||||
|
@ -340,8 +340,8 @@ private class TagWorkerImpl(
|
||||||
rawSong.albumArtistMusicBrainzIds = it
|
rawSong.albumArtistMusicBrainzIds = it
|
||||||
}
|
}
|
||||||
(comments["albumartists"]
|
(comments["albumartists"]
|
||||||
?: comments["album_artists"] ?: comments["album artists"]
|
?: comments["album_artists"] ?: comments["album artists"] ?: comments["albumartist"]
|
||||||
?: comments["albumartist"] ?: comments["album artist"])
|
?: comments["album artist"])
|
||||||
?.let { rawSong.albumArtistNames = it }
|
?.let { rawSong.albumArtistNames = it }
|
||||||
(comments["albumartistssort"]
|
(comments["albumartistssort"]
|
||||||
?: comments["albumartists_sort"] ?: comments["albumartists sort"]
|
?: comments["albumartists_sort"] ?: comments["albumartists sort"]
|
||||||
|
|
Loading…
Reference in a new issue