mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 07:21:58 +00:00
Merge pull request #1062 from VenusIsJaded/fix/imdb-zero-rating-unreleased
fix: hide IMDb 0.0 rating on unreleased content
This commit is contained in:
commit
cd4bc058cf
1 changed files with 5 additions and 3 deletions
|
|
@ -80,10 +80,12 @@ fun DetailMetaInfo(
|
||||||
val runtimeText = formatRuntimeForDisplay(meta.runtime)
|
val runtimeText = formatRuntimeForDisplay(meta.runtime)
|
||||||
val ageBadge = meta.ageRating?.trim()?.takeIf { it.isNotBlank() }
|
val ageBadge = meta.ageRating?.trim()?.takeIf { it.isNotBlank() }
|
||||||
val hasMdbImdbRating = meta.externalRatings.any { it.source == PROVIDER_IMDB }
|
val hasMdbImdbRating = meta.externalRatings.any { it.source == PROVIDER_IMDB }
|
||||||
|
val validImdbRating = meta.imdbRating
|
||||||
|
?.takeIf { raw -> raw.toDoubleOrNull()?.let { it > 0.0 } == true }
|
||||||
val hasMetaRow = releaseLine != null ||
|
val hasMetaRow = releaseLine != null ||
|
||||||
runtimeText != null ||
|
runtimeText != null ||
|
||||||
ageBadge != null ||
|
ageBadge != null ||
|
||||||
(meta.imdbRating != null && !hasMdbImdbRating)
|
(validImdbRating != null && !hasMdbImdbRating)
|
||||||
if (hasMetaRow) {
|
if (hasMetaRow) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
|
@ -108,7 +110,7 @@ fun DetailMetaInfo(
|
||||||
ageBadge?.let { badge ->
|
ageBadge?.let { badge ->
|
||||||
DetailHeroMetaBadge(text = badge)
|
DetailHeroMetaBadge(text = badge)
|
||||||
}
|
}
|
||||||
if (meta.imdbRating != null && !hasMdbImdbRating) {
|
if (validImdbRating != null && !hasMdbImdbRating) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
|
|
@ -129,7 +131,7 @@ fun DetailMetaInfo(
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.width(5.dp))
|
Spacer(modifier = Modifier.width(5.dp))
|
||||||
Text(
|
Text(
|
||||||
text = meta.imdbRating,
|
text = validImdbRating,
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
color = ImdbYellow,
|
color = ImdbYellow,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue