Fixing bug when preference is not set

This commit is contained in:
thomas 2020-09-21 00:39:26 -04:00
parent 991c4ee36e
commit 5d1a75bc13

View file

@ -15,6 +15,7 @@
package code.name.monkey.retromusic.model
import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import java.util.*
data class Artist(
@ -25,10 +26,11 @@ data class Artist(
val name: String
get() {
val name = safeGetFirstAlbum().safeGetFirstSong().albumArtist
if (PreferenceUtil.albumArtistsOnly && MusicUtil.isVariousArtists(name)) {
return VARIOUS_ARTISTS_DISPLAY_NAME
}
return if (MusicUtil.isArtistNameUnknown(name)) {
UNKNOWN_ARTIST_DISPLAY_NAME
} else if (MusicUtil.isVariousArtists(name)) {
VARIOUS_ARTISTS_DISPLAY_NAME
} else safeGetFirstAlbum().safeGetFirstSong().artistName
}