diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/NowPlayingView.kt b/app/src/main/java/org/jellyfin/androidtv/ui/NowPlayingView.kt index 2bf183458f..01321a1892 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/NowPlayingView.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/NowPlayingView.kt @@ -138,7 +138,8 @@ fun NowPlayingComposable() { ) { // Name Text(text = item?.name.orEmpty(), maxLines = 1, overflow = TextOverflow.Ellipsis) - Text(text = item?.albumArtist.orEmpty(), maxLines = 1, overflow = TextOverflow.Ellipsis) + val artists = item?.artists ?: item?.albumArtists ?: item?.albumArtist?.let(::listOf) + Text(text = artists?.joinToString(", ").orEmpty(), maxLines = 1, overflow = TextOverflow.Ellipsis) } } } diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/itemhandling/BaseItemDtoBaseRowItem.kt b/app/src/main/java/org/jellyfin/androidtv/ui/itemhandling/BaseItemDtoBaseRowItem.kt index 9dd032b35a..408edb6e4a 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/itemhandling/BaseItemDtoBaseRowItem.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/itemhandling/BaseItemDtoBaseRowItem.kt @@ -79,6 +79,8 @@ open class BaseItemDtoBaseRowItem @JvmOverloads constructor( } override fun getCardName(context: Context) = when { + baseItem?.type == BaseItemKind.AUDIO && baseItem.artists != null -> baseItem.artists?.joinToString(", ") + baseItem?.type == BaseItemKind.AUDIO && baseItem.albumArtists != null -> baseItem.albumArtists?.joinToString(", ") baseItem?.type == BaseItemKind.AUDIO && baseItem.albumArtist != null -> baseItem.albumArtist baseItem?.type == BaseItemKind.AUDIO && baseItem.album != null -> baseItem.album else -> baseItem?.getFullName(context) diff --git a/app/src/main/java/org/jellyfin/androidtv/util/sdk/BaseItemExtensions.kt b/app/src/main/java/org/jellyfin/androidtv/util/sdk/BaseItemExtensions.kt index 357e0a190d..aa6e33b0f3 100644 --- a/app/src/main/java/org/jellyfin/androidtv/util/sdk/BaseItemExtensions.kt +++ b/app/src/main/java/org/jellyfin/androidtv/util/sdk/BaseItemExtensions.kt @@ -21,6 +21,7 @@ fun BaseItemDto.getSeasonEpisodeName(context: Context): String { && parentIndexNumber != null && parentIndexNumber != 0 -> context.getString(R.string.lbl_season_number, parentIndexNumber) + else -> null } @@ -69,11 +70,13 @@ fun BaseItemDto.getProgramSubText(context: Context) = buildString { append(TimeUtils.getFriendlyDate(context, startDate), " ") // Add the start and end time - append(context.getString( - R.string.lbl_time_range, - context.getTimeFormatter().format(startDate), - context.getTimeFormatter().format(endDate), - )) + append( + context.getString( + R.string.lbl_time_range, + context.getTimeFormatter().format(startDate), + context.getTimeFormatter().format(endDate), + ) + ) } fun BaseItemDto.getFirstPerson(searchedType: PersonKind) = people?.firstOrNull { it.type == searchedType } @@ -97,9 +100,11 @@ fun BaseItemDto.getFullName(context: Context): String? = when (type) { }.filterNot { it.isNullOrBlank() }.joinToString(" ") // we actually want the artist name if available BaseItemKind.AUDIO, - BaseItemKind.MUSIC_ALBUM -> listOfNotNull(albumArtist, name) - .filter { it.isNotEmpty() } - .joinToString(" - ") + BaseItemKind.MUSIC_ALBUM -> listOfNotNull( + artists?.joinToString(", ") ?: albumArtists?.joinToString(", ") ?: albumArtist, + name + ).filter { it.isNotEmpty() }.joinToString(" - ") + else -> name } @@ -111,16 +116,20 @@ fun BaseItemDto.getSubName(context: Context): String? = when (type) { name, TimeUtils.getFriendlyDate(context, premiereDate) ) + else -> name } + BaseItemKind.SEASON -> when { childCount != null && childCount!! > 0 -> context.getQuantityString(R.plurals.episodes, childCount!!) else -> "" } + BaseItemKind.MUSIC_ALBUM -> when { childCount != null && childCount!! > 0 -> context.getQuantityString(R.plurals.tracks, childCount!!) else -> "" } + BaseItemKind.AUDIO -> name else -> officialRating } @@ -137,6 +146,7 @@ fun BaseItemDto.buildChapterItems(api: ApiClient): List = chapt tag = dto.imageTag, imageIndex = i, ) + else -> null }, )