mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Fix two UI issues (#856)
## Description Fixes UI issues: - Showing unplayed corner text on multi-part movies - Fix duplicate or missing rating info on discover movie & series pages ### Related issues N/A ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
6ec10b9b82
commit
6954d821ed
5 changed files with 28 additions and 23 deletions
|
|
@ -91,12 +91,16 @@ data class BaseItem(
|
||||||
episodeCornerText =
|
episodeCornerText =
|
||||||
data.indexNumber?.let { "E$it" }
|
data.indexNumber?.let { "E$it" }
|
||||||
?: data.premiereDate?.let(::formatDateTime),
|
?: data.premiereDate?.let(::formatDateTime),
|
||||||
episdodeUnplayedCornerText =
|
episodeUnplayedCornerText =
|
||||||
data.indexNumber?.let { "E$it" }
|
if (type == BaseItemKind.SERIES || type == BaseItemKind.SEASON || type == BaseItemKind.BOX_SET) {
|
||||||
?: data.userData
|
data.indexNumber?.let { "E$it" }
|
||||||
?.unplayedItemCount
|
?: data.userData
|
||||||
?.takeIf { it > 0 }
|
?.unplayedItemCount
|
||||||
?.let { abbreviateNumber(it) },
|
?.takeIf { it > 0 }
|
||||||
|
?.let { abbreviateNumber(it) }
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
},
|
||||||
quickDetails =
|
quickDetails =
|
||||||
buildAnnotatedString {
|
buildAnnotatedString {
|
||||||
val details =
|
val details =
|
||||||
|
|
@ -207,6 +211,6 @@ val BaseItemDto.aspectRatioFloat: Float? get() = width?.let { w -> height?.let {
|
||||||
@Immutable
|
@Immutable
|
||||||
data class BaseItemUi(
|
data class BaseItemUi(
|
||||||
val episodeCornerText: String?,
|
val episodeCornerText: String?,
|
||||||
val episdodeUnplayedCornerText: String?,
|
val episodeUnplayedCornerText: String?,
|
||||||
val quickDetails: AnnotatedString,
|
val quickDetails: AnnotatedString,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -167,19 +167,19 @@ fun listToDotString(
|
||||||
strings.forEachIndexed { index, string ->
|
strings.forEachIndexed { index, string ->
|
||||||
append(string)
|
append(string)
|
||||||
if (index != strings.lastIndex) dot()
|
if (index != strings.lastIndex) dot()
|
||||||
communityRating?.let {
|
}
|
||||||
dot()
|
communityRating?.let {
|
||||||
append(String.format(Locale.getDefault(), "%.1f", it))
|
dot()
|
||||||
appendInlineContent(id = "star")
|
append(String.format(Locale.getDefault(), "%.1f", it))
|
||||||
}
|
appendInlineContent(id = "star")
|
||||||
criticRating?.let {
|
}
|
||||||
dot()
|
criticRating?.let {
|
||||||
append("${it.toInt()}%")
|
dot()
|
||||||
if (it >= 60f) {
|
append("${it.toInt()}%")
|
||||||
appendInlineContent(id = "fresh")
|
if (it >= 60f) {
|
||||||
} else {
|
appendInlineContent(id = "fresh")
|
||||||
appendInlineContent(id = "rotten")
|
} else {
|
||||||
}
|
appendInlineContent(id = "rotten")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ fun DiscoverMovieDetailsHeader(
|
||||||
) {
|
) {
|
||||||
val padding = 4.dp
|
val padding = 4.dp
|
||||||
val details =
|
val details =
|
||||||
remember(movie) {
|
remember(movie, rating) {
|
||||||
buildList {
|
buildList {
|
||||||
movie.releaseDate?.let(::add)
|
movie.releaseDate?.let(::add)
|
||||||
movie.runtime
|
movie.runtime
|
||||||
|
|
@ -89,6 +89,7 @@ fun DiscoverMovieDetailsHeader(
|
||||||
?.releaseDates
|
?.releaseDates
|
||||||
?.firstOrNull()
|
?.firstOrNull()
|
||||||
?.certification
|
?.certification
|
||||||
|
?.takeIf { it.isNotNullOrBlank() }
|
||||||
?.let(::add)
|
?.let(::add)
|
||||||
}.let {
|
}.let {
|
||||||
listToDotString(
|
listToDotString(
|
||||||
|
|
|
||||||
|
|
@ -463,7 +463,7 @@ fun DiscoverSeriesDetailsHeader(
|
||||||
) {
|
) {
|
||||||
val padding = 4.dp
|
val padding = 4.dp
|
||||||
val details =
|
val details =
|
||||||
remember(series) {
|
remember(series, rating) {
|
||||||
buildList {
|
buildList {
|
||||||
series.firstAirDate?.let(::add)
|
series.firstAirDate?.let(::add)
|
||||||
series.episodeRunTime
|
series.episodeRunTime
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ fun HomePageContent(
|
||||||
name = item?.data?.seriesName ?: item?.name,
|
name = item?.data?.seriesName ?: item?.name,
|
||||||
item = item,
|
item = item,
|
||||||
aspectRatio = AspectRatios.TALL,
|
aspectRatio = AspectRatios.TALL,
|
||||||
cornerText = item?.ui?.episdodeUnplayedCornerText,
|
cornerText = item?.ui?.episodeUnplayedCornerText,
|
||||||
played = item?.data?.userData?.played ?: false,
|
played = item?.data?.userData?.played ?: false,
|
||||||
favorite = item?.favorite ?: false,
|
favorite = item?.favorite ?: false,
|
||||||
playPercent =
|
playPercent =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue