music: prioritize earlier album artist info

Prioritize artist information from earlier albums (date-wise), as it's
less likely to change with the addition of new music.
This commit is contained in:
Alexander Capehart 2023-06-15 19:11:31 -06:00
parent 5825a29e00
commit 7b4af3515d
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -218,13 +218,13 @@ class DeviceLibraryFactoryImpl @Inject constructor(private val musicSettings: Mu
// Immediately replace any songs that initially held the priority position.
is SongImpl -> body.raw = PrioritizedRaw(rawArtist, album)
is AlbumImpl -> {
// Album information from later dates is prioritized, as it is more
// likely to contain the "modern" name of the artist if the information
// really is in-consistent. Fall back to the name otherwise.
// Album artist information from earlier dates is prioritized, as it is
// less likely to change with the addition of new tracks. Fall back to
// the name otherwise.
val prioritize =
album.dates != null &&
(prioritized.dates == null ||
album.dates > prioritized.dates ||
album.dates < prioritized.dates ||
(album.dates == prioritized.dates &&
album.name < prioritized.name))