refactor: rename imageUrl to primaryImageUrl for consistency across components

This commit is contained in:
2026-04-19 20:08:41 +02:00
parent 52a51b1b28
commit a0086c6f62
7 changed files with 14 additions and 14 deletions

View File

@@ -45,7 +45,7 @@ internal fun TvFocusedItemHero(
.background(scheme.background) .background(scheme.background)
) { ) {
Crossfade( Crossfade(
targetState = item.imageUrl, targetState = item.primaryImageUrl,
animationSpec = tween(durationMillis = TvHomeHeroAnimationMillis), animationSpec = tween(durationMillis = TvHomeHeroAnimationMillis),
label = "tv-home-hero-background" label = "tv-home-hero-background"
) { imageUrl -> ) { imageUrl ->

View File

@@ -86,7 +86,7 @@ fun TvContinueWatchingSection(
TvHomeLandscapeCard( TvHomeLandscapeCard(
title = item.primaryText, title = item.primaryText,
supporting = item.secondaryText, supporting = item.secondaryText,
imageUrl = item.imageUrl, imageUrl = item.primaryImageUrl,
progress = item.progress ?: 0f, progress = item.progress ?: 0f,
imageModifier = Modifier imageModifier = Modifier
.then( .then(
@@ -138,7 +138,7 @@ fun TvNextUpSection(
TvHomeLandscapeCard( TvHomeLandscapeCard(
title = item.primaryText, title = item.primaryText,
supporting = item.secondaryText, supporting = item.secondaryText,
imageUrl = item.imageUrl, imageUrl = item.primaryImageUrl,
imageModifier = Modifier imageModifier = Modifier
.then( .then(
if (index == 0 && firstItemFocusRequester != null) { if (index == 0 && firstItemFocusRequester != null) {

View File

@@ -63,7 +63,7 @@ internal fun ContinueWatchingCard(
.background(scheme.surfaceContainer) .background(scheme.surfaceContainer)
) { ) {
PurefinAsyncImage( PurefinAsyncImage(
model = item.imageUrl, model = item.primaryImageUrl,
contentDescription = item.primaryText, contentDescription = item.primaryText,
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Crop contentScale = ContentScale.Crop

View File

@@ -66,7 +66,7 @@ internal fun HomeBrowseCard(
.background(scheme.surface) .background(scheme.surface)
) { ) {
PurefinAsyncImage( PurefinAsyncImage(
model = uiModel.imageUrl, model = uiModel.primaryImageUrl,
contentDescription = uiModel.primaryText, contentDescription = uiModel.primaryText,
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Crop contentScale = ContentScale.Crop

View File

@@ -58,7 +58,7 @@ internal fun NextUpCard(
.background(scheme.surface) .background(scheme.surface)
) { ) {
PurefinAsyncImage( PurefinAsyncImage(
model = uiModel.imageUrl, model = uiModel.primaryImageUrl,
contentDescription = uiModel.primaryText, contentDescription = uiModel.primaryText,
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Crop contentScale = ContentScale.Crop

View File

@@ -12,7 +12,7 @@ sealed interface MediaUiModel {
val primaryText: String val primaryText: String
val secondaryText: String val secondaryText: String
val description: String val description: String
val imageUrl: String val primaryImageUrl: String
val progress: Float? val progress: Float?
get() = null get() = null
val watched: Boolean val watched: Boolean
@@ -24,7 +24,7 @@ class MovieUiModel: MediaUiModel {
override val primaryText: String override val primaryText: String
override val secondaryText: String override val secondaryText: String
override val description: String override val description: String
override val imageUrl: String override val primaryImageUrl: String
override val progress: Float? override val progress: Float?
constructor(movie: Movie) { constructor(movie: Movie) {
@@ -32,7 +32,7 @@ class MovieUiModel: MediaUiModel {
primaryText = movie.title primaryText = movie.title
secondaryText = movie.year secondaryText = movie.year
description = movie.synopsis description = movie.synopsis
imageUrl = ImageUrlBuilder.finishImageUrl( primaryImageUrl = ImageUrlBuilder.finishImageUrl(
prefixImageUrl = movie.imageUrlPrefix, prefixImageUrl = movie.imageUrlPrefix,
artworkKind = ArtworkKind.PRIMARY artworkKind = ArtworkKind.PRIMARY
) )
@@ -68,14 +68,14 @@ class SeriesUiModel : MediaUiModel {
override val primaryText: String override val primaryText: String
override val secondaryText: String override val secondaryText: String
override val description: String override val description: String
override val imageUrl: String override val primaryImageUrl: String
constructor(series: Series) { constructor(series: Series) {
id = series.id id = series.id
primaryText = series.name primaryText = series.name
secondaryText = "${series.seasonCount} seasons" secondaryText = "${series.seasonCount} seasons"
description = series.synopsis description = series.synopsis
imageUrl = ImageUrlBuilder.finishImageUrl( primaryImageUrl = ImageUrlBuilder.finishImageUrl(
prefixImageUrl = series.imageUrlPrefix, prefixImageUrl = series.imageUrlPrefix,
artworkKind = ArtworkKind.PRIMARY artworkKind = ArtworkKind.PRIMARY
) )
@@ -87,7 +87,7 @@ class EpisodeUiModel : MediaUiModel {
override val primaryText: String override val primaryText: String
override val secondaryText: String override val secondaryText: String
override val description: String override val description: String
override val imageUrl: String override val primaryImageUrl: String
override val progress: Float? override val progress: Float?
val seriesId: UUID val seriesId: UUID
val seasonId: UUID val seasonId: UUID
@@ -97,7 +97,7 @@ class EpisodeUiModel : MediaUiModel {
primaryText = episode.title primaryText = episode.title
secondaryText = episode.releaseDate secondaryText = episode.releaseDate
description = episode.synopsis description = episode.synopsis
imageUrl = ImageUrlBuilder.finishImageUrl( primaryImageUrl = ImageUrlBuilder.finishImageUrl(
prefixImageUrl = episode.imageUrlPrefix, prefixImageUrl = episode.imageUrlPrefix,
artworkKind = ArtworkKind.PRIMARY artworkKind = ArtworkKind.PRIMARY
) )

View File

@@ -90,7 +90,7 @@ fun PosterCardContent(
) { ) {
Box { Box {
PurefinAsyncImage( PurefinAsyncImage(
model = model.imageUrl, model = model.primaryImageUrl,
contentDescription = null, contentDescription = null,
modifier = imageModifier modifier = imageModifier
.aspectRatio(2f / 3f) .aspectRatio(2f / 3f)