feature: add season and episode numbers to every episode occurence

This commit is contained in:
2026-01-26 17:37:10 +01:00
parent 3dc9ec7524
commit 71812f076f
12 changed files with 32 additions and 13 deletions

View File

@@ -16,6 +16,8 @@ object ContentMockData {
val episode1 = SeriesEpisodeUiModel(
id = "1",
title = "E1: The Beginning",
seasonNumber = 1,
episodeNumber = 1,
description = "The crew assembles for the first time as the anomaly begins to expand rapidly near Saturn's rings.",
duration = "58m",
imageUrl = "https://lh3.googleusercontent.com/aida-public/AB6AXuC6OPszCXCIP_FMO3BJJUrjpCtDNw9aeHYOGyOAXdqF078hDFNrH7KXbaQ7qtipz6aIPLivd8VBBffNMbeAiYIjjWjn5GMb6Xn9iiJz0D2rzhCKi0TBeFrN6tC1IXJkzQyQKJNhTnyokWy9dd-YtN65V7er7RT6hP5jdVBXhtK1xZMjlgrm1bk_FTTmKd8Afu3zPtJCaaC98Z608vav5zhYlkrdA1wKNSTWTpzwMSyDIY3pNQNPFauWf0n-iEu7QsYTAwhCG_zfxz0",
@@ -25,6 +27,8 @@ object ContentMockData {
val episode2 = SeriesEpisodeUiModel(
id = "2",
title = "E2: Event Horizon",
seasonNumber = 1,
episodeNumber = 2,
description = "Dr. Cole discovers a frequency embedded in the rift's radiation that suggests intelligent design.",
duration = "54m",
imageUrl = "https://lh3.googleusercontent.com/aida-public/AB6AXuBExsf-wEzAVjMxasU2ImGhlreqQo9biBSN1yHyAbW8MyuhuppRw9ho7OD3vsbySSJ3kNluEgH1Qun45PmLnZWixZsFU4Qc7UGGJNKMS5Nkm4GZAsKdFvb3z_i1tkCvaXXvGpqmwI0qjFuo1QyjjhYPA5Yp3I8ZhrnDYdQv_GxbhR6Vl3mY1rbxd2BIUEE5oMTwTF-QmJztUEaViZkSGSG2VgVXZ5VAREn4xWE902OH2sysllvXQJQIaj439JIC2_Vg61m0-F-F1Vc",
@@ -34,6 +38,8 @@ object ContentMockData {
val episode3 = SeriesEpisodeUiModel(
id = "3",
title = "E3: Singularity",
seasonNumber = 1,
episodeNumber = 3,
description = "Tension rises as the ship approaches the event horizon, and the AI begins to behave erratically.",
duration = "1h 02m",
imageUrl = "https://lh3.googleusercontent.com/aida-public/AB6AXuA5CFDWsWYO4YxdRoLd2QfH5Su2KLhtj5xSDb8qmzWHvPE888ac_HAAj1wu1uqdFNSncdmmJ-bWsc--h6NYKxVXkhd4vHaFWi0XTJXgsR0F3cBu_l2SynSX4TMNSy5C3XWDurgeSH789byOe1HvoxHCHTJYaSf3OyEbil-NOp9g_9mZ24CIZOI79nx57CRzmooxoswycqssPpfTNkrnoYrrAczt5qbncwLM9NVU442YxyBFisr2Ds9H-CNBOakiCtaKnoJ6npznM7U",
@@ -154,6 +160,8 @@ object ContentMockData {
return EpisodeUiModel(
id = UUID.randomUUID(),
title = "S1E1 · Event Horizon",
seasonNumber = 1,
episodeNumber = 1,
releaseDate = "Oct 12, 2024",
rating = "TV-MA",
runtime = "58m",

View File

@@ -89,6 +89,13 @@ internal fun EpisodeDetails(
fontWeight = FontWeight.Bold,
lineHeight = 38.sp
)
Spacer(modifier = Modifier.height(4.dp))
Text(
text = "Season ${episode.seasonNumber}, Episode ${episode.episodeNumber}",
color = scheme.onBackground,
fontSize = 14.sp,
fontWeight = FontWeight.Medium
)
Spacer(modifier = Modifier.height(16.dp))
FlowRow(
horizontalArrangement = Arrangement.spacedBy(8.dp),

View File

@@ -11,6 +11,8 @@ data class CastMember(
data class EpisodeUiModel(
val id: UUID,
val title: String,
val seasonNumber: Int,
val episodeNumber: Int,
val releaseDate: String,
val rating: String,
val runtime: String,

View File

@@ -70,7 +70,7 @@ private fun EpisodeScreenInternal(
MediaHero(
imageUrl = episode.heroImageUrl,
backgroundColor = MaterialTheme.colorScheme.background,
height = 300.dp,
height = 250.dp,
modifier = Modifier.fillMaxWidth()
)
EpisodeDetails(

View File

@@ -91,6 +91,8 @@ class EpisodeScreenViewModel @Inject constructor(
return EpisodeUiModel(
id = id,
title = name ?: "Unknown title",
seasonNumber = parentIndexNumber!!,
episodeNumber = indexNumber!!,
releaseDate = releaseDate,
rating = rating,
runtime = runtime,

View File

@@ -65,7 +65,7 @@ private fun MovieScreenInternal(
MediaHero(
imageUrl = movie.heroImageUrl,
backgroundColor = MaterialTheme.colorScheme.background,
height = 300.dp,
height = 250.dp,
modifier = Modifier.fillMaxWidth()
)
MovieDetails(

View File

@@ -249,22 +249,21 @@ private fun EpisodeCard(
}
}
Column(
verticalArrangement = Arrangement.spacedBy(6.dp)
//verticalArrangement = Arrangement.spacedBy(2.dp)
) {
Text(
text = episode.title,
color = scheme.onBackground,
fontSize = 13.sp,
fontSize = 14.sp,
fontWeight = FontWeight.Bold,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Text(
text = episode.description,
text = "S${episode.seasonNumber} • E${episode.episodeNumber}",
color = mutedStrong,
fontSize = 11.sp,
lineHeight = 16.sp,
maxLines = 2,
fontSize = 12.sp,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
}

View File

@@ -3,6 +3,8 @@ package hu.bbara.purefin.app.content.series
data class SeriesEpisodeUiModel(
val id: String,
val title: String,
val seasonNumber: Int,
val episodeNumber: Int,
val description: String,
val duration: String,
val imageUrl: String,

View File

@@ -90,7 +90,7 @@ private fun SeriesScreenInternal(
) {
MediaHero(
imageUrl = series.heroImageUrl,
height = 350.dp,
height = 250.dp,
backgroundColor = MaterialTheme.colorScheme.background,
modifier = Modifier.fillMaxWidth()
)
@@ -125,7 +125,6 @@ private fun SeriesScreenInternal(
selectedSeason = selectedSeason.value,
onSelect = { selectedSeason.value = it }
)
// Spacer(modifier = Modifier.height(16.dp))
EpisodeCarousel(
episodes = selectedSeason.value.episodes
)

View File

@@ -77,6 +77,8 @@ class SeriesViewModel @Inject constructor(
SeriesEpisodeUiModel(
id = episode.id.toString(),
title = episode.name ?: "Unknown",
seasonNumber = episode.parentIndexNumber!!,
episodeNumber = episode.indexNumber!!,
description = episode.overview ?: "",
duration = "58m",
imageUrl = JellyfinImageHelper.toImageUrl(url = serverUrl, itemId = episode.id, type = ImageType.PRIMARY),

View File

@@ -98,7 +98,7 @@ class HomePageViewModel @Inject constructor(
id = it.id,
type = BaseItemKind.EPISODE,
primaryText = it.seriesName!!,
secondaryText = it.name!!,
secondaryText = "S${it.parentIndexNumber!!}:${it.indexNumber!!} - ${it.name!!}",
progress = it.userData!!.playedPercentage!!,
colors = listOf(Color.Red, Color.Green),
)

View File

@@ -89,8 +89,6 @@ class JellyfinApiClient @Inject constructor(
val getResumeItemsRequest = GetResumeItemsRequest(
userId = userId,
startIndex = 0,
//TODO remove this limit if needed
// limit = 10
)
val response: Response<BaseItemDtoQueryResult> = api.itemsApi.getResumeItems(getResumeItemsRequest)
Log.d("getContinueWatching response: {}", response.content.toString())