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

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

View File

@@ -1,7 +1,6 @@
package hu.bbara.purefin.core.data.room.entity
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey
import java.util.UUID
@@ -16,7 +15,7 @@ data class SeriesEntity(
val name: String,
val synopsis: String,
val year: String,
val heroImageUrl: String,
val imageUrlPrefix: String,
val unwatchedEpisodeCount: Int,
val seasonCount: Int
)

View File

@@ -23,7 +23,7 @@ import hu.bbara.purefin.core.data.room.entity.SmartDownloadEntity
EpisodeEntity::class,
SmartDownloadEntity::class,
],
version = 7,
version = 8,
exportSchema = false
)
@TypeConverters(UuidConverters::class)
@@ -33,4 +33,4 @@ abstract class OfflineMediaDatabase : RoomDatabase() {
abstract fun seasonDao(): SeasonDao
abstract fun episodeDao(): EpisodeDao
abstract fun smartDownloadDao(): SmartDownloadDao
}
}

View File

@@ -219,7 +219,7 @@ class OfflineRoomMediaLocalDataSource(
name = name,
synopsis = synopsis,
year = year,
heroImageUrl = heroImageUrl,
imageUrlPrefix = imageUrlPrefix,
unwatchedEpisodeCount = unwatchedEpisodeCount,
seasonCount = seasonCount
)
@@ -272,7 +272,7 @@ class OfflineRoomMediaLocalDataSource(
name = name,
synopsis = synopsis,
year = year,
heroImageUrl = heroImageUrl,
imageUrlPrefix = imageUrlPrefix,
unwatchedEpisodeCount = unwatchedEpisodeCount,
seasonCount = seasonCount,
seasons = seasons,
@@ -305,4 +305,4 @@ class OfflineRoomMediaLocalDataSource(
heroImageUrl = heroImageUrl,
cast = emptyList()
)
}
}

View File

@@ -8,7 +8,7 @@ data class Series(
val name: String,
val synopsis: String,
val year: String,
val heroImageUrl: String,
val imageUrlPrefix: String,
val unwatchedEpisodeCount: Int,
val seasonCount: Int,
val seasons: List<Season>,