refactor: update image handling in Series dto to use imageUrlPrefix and JellyfinImageHelper

This commit is contained in:
2026-04-01 22:38:58 +02:00
parent ce5266f17c
commit 98850087ff
10 changed files with 25 additions and 21 deletions

View File

@@ -385,10 +385,9 @@ class MediaDownloadManager @Inject constructor(
name = name ?: "Unknown",
synopsis = overview ?: "No synopsis available",
year = productionYear?.toString() ?: premiereDate?.year?.toString().orEmpty(),
heroImageUrl = JellyfinImageHelper.toImageUrl(
imageUrlPrefix = JellyfinImageHelper.toPrefixImageUrl(
url = serverUrl,
itemId = id,
type = ImageType.PRIMARY
itemId = id
),
unwatchedEpisodeCount = userData?.unplayedItemCount ?: 0,
seasonCount = childCount ?: 0,

View File

@@ -58,7 +58,10 @@ data class SuggestedSeries (
override val id: UUID = series.id,
override val title: String = series.name,
override val description: String = series.synopsis,
override val imageUrl: String = series.heroImageUrl
override val imageUrl: String = JellyfinImageHelper.finishImageUrl(
prefixImageUrl = series.imageUrlPrefix,
imageType = ImageType.PRIMARY
)
) : SuggestedItem
data class SuggestedMovie (
@@ -146,7 +149,7 @@ data class PosterItem(
val imageUrl: String = when (type) {
BaseItemKind.MOVIE -> movie!!.imageUrlPrefix
BaseItemKind.EPISODE -> episode!!.heroImageUrl
BaseItemKind.SERIES -> series!!.heroImageUrl
BaseItemKind.SERIES -> series!!.imageUrlPrefix
else -> throw IllegalArgumentException("Invalid type: $type")
}
fun watched() = when (type) {