Better images for genre grid (#501)

## Description
Overhauls the genre cards for Movies & TV Show libraries.

Now the cards use a semi-transparent, consistent, generated color using
the same logic as in #478. And a random item from the library with that
genre is show in the background. This is heavily inspired from Plex.

If there are not applicable items for the genre, then just the colored
card is shown.

### Related issues
Fixes #490
This commit is contained in:
Ray 2025-12-19 10:46:57 -05:00 committed by GitHub
parent e60748a0d0
commit 693398536e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 252 additions and 24 deletions

View file

@ -1,8 +1,10 @@
package com.github.damontecres.wholphin.data.model
import com.github.damontecres.wholphin.ui.detail.CardGridItem
import com.github.damontecres.wholphin.ui.detail.series.SeasonEpisodeIds
import com.github.damontecres.wholphin.ui.formatDateTime
import com.github.damontecres.wholphin.ui.nav.Destination
import com.github.damontecres.wholphin.ui.playback.playable
import com.github.damontecres.wholphin.ui.seasonEpisode
import com.github.damontecres.wholphin.ui.seasonEpisodePadded
import com.github.damontecres.wholphin.ui.seriesProductionYears
@ -18,8 +20,14 @@ import kotlin.time.Duration
data class BaseItem(
val data: BaseItemDto,
val useSeriesForPrimary: Boolean,
) {
val id get() = data.id
) : CardGridItem {
override val id get() = data.id
override val playable: Boolean
get() = type.playable
override val sortName: String
get() = data.sortName ?: data.name ?: ""
val type get() = data.type