Several minor bug fixes (#1866)

## Description
Another PR to gather small bug fixes:
- Fix aspect ratio for episodes on person page
- Use the song's artist instead of the album's artist on album page
- Fix how the dim percentage is applied to the OS screensaver dim
percentage (#1834)

### Related issues
Fixes #1851 
Fixes #1863

### Testing
<!-- Describe how this change was tested and on what device(s) -->

## Screenshots
<!-- Please include screenshots if the PR alters any UI elements -->

## AI or LLM usage
<!-- If you used any AI or LLM assistance, please list where in the code
and how you tested it -->
This commit is contained in:
Damontecres 2026-08-20 17:09:39 -04:00 • committed by GitHub
parent ed204ef7e9
commit 39523aa6e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 33 additions and 24 deletions

View file

@ -154,7 +154,9 @@ fun MainContent(
val alpha = val alpha =
userPreferences.appPreferences.interfacePreferences.screensaverPreference.dimPercent / 100f userPreferences.appPreferences.interfacePreferences.screensaverPreference.dimPercent / 100f
Box( Box(
Modifier.background(Color.Black.copy(alpha = alpha)), Modifier
.fillMaxSize()
.background(Color.Black.copy(alpha = alpha)),
) )
} }
} }

View file

@ -1,6 +1,8 @@
package com.github.damontecres.wholphin package com.github.damontecres.wholphin
import android.service.dreams.DreamService import android.service.dreams.DreamService
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
@ -9,7 +11,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.ComposeView import androidx.compose.ui.platform.ComposeView
import androidx.datastore.core.DataStore import androidx.datastore.core.DataStore
import androidx.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
@ -95,14 +97,6 @@ class WholphinDreamService :
preferencesDataStore.data.collectLatest { prefs = it } preferencesDataStore.data.collectLatest { prefs = it }
} }
prefs?.let { prefs -> prefs?.let { prefs ->
val alpha =
prefs.interfacePreferences.screensaverPreference.run {
if (dimEnabled) {
dimPercent / 100f
} else {
1f
}
}
CoilConfig( CoilConfig(
prefs = prefs, prefs = prefs,
okHttpClient = okHttpClient, okHttpClient = okHttpClient,
@ -113,16 +107,23 @@ class WholphinDreamService :
ProvideLocalClock { ProvideLocalClock {
val screensaverPrefs = prefs.interfacePreferences.screensaverPreference val screensaverPrefs = prefs.interfacePreferences.screensaverPreference
val currentItem by itemFlow.collectAsState(null) val currentItem by itemFlow.collectAsState(null)
AppScreensaverContent( Box(Modifier.fillMaxSize()) {
currentItem = currentItem, AppScreensaverContent(
showClock = screensaverPrefs.showClock, currentItem = currentItem,
duration = screensaverPrefs.duration.milliseconds, showClock = screensaverPrefs.showClock,
animate = screensaverPrefs.animate, duration = screensaverPrefs.duration.milliseconds,
modifier = animate = screensaverPrefs.animate,
Modifier modifier = Modifier.fillMaxSize(),
.fillMaxSize() )
.alpha(alpha = alpha), if (screensaverPrefs.dimEnabled) {
) val alpha = screensaverPrefs.dimPercent / 100f
Box(
Modifier
.fillMaxSize()
.background(Color.Black.copy(alpha = alpha)),
)
}
}
} }
} }
} }

View file

@ -85,7 +85,6 @@ class ScreensaverService
* Reset the timer before showing the in-app screensaver * Reset the timer before showing the in-app screensaver
*/ */
fun pulse() { fun pulse() {
Timber.v("state=%s", _state.value)
waitJob?.cancel() waitJob?.cancel()
if (_state.value.enabled) { if (_state.value.enabled) {
// Timber.v("pulse") // Timber.v("pulse")

View file

@ -46,10 +46,11 @@ import com.github.damontecres.wholphin.preferences.UserPreferences
import com.github.damontecres.wholphin.services.FavoriteWatchManager import com.github.damontecres.wholphin.services.FavoriteWatchManager
import com.github.damontecres.wholphin.services.NavigationManager import com.github.damontecres.wholphin.services.NavigationManager
import com.github.damontecres.wholphin.services.SeerrService import com.github.damontecres.wholphin.services.SeerrService
import com.github.damontecres.wholphin.ui.AspectRatios
import com.github.damontecres.wholphin.ui.Cards import com.github.damontecres.wholphin.ui.Cards
import com.github.damontecres.wholphin.ui.ItemRowFields
import com.github.damontecres.wholphin.ui.LocalImageUrlService import com.github.damontecres.wholphin.ui.LocalImageUrlService
import com.github.damontecres.wholphin.ui.PreviewTvSpec import com.github.damontecres.wholphin.ui.PreviewTvSpec
import com.github.damontecres.wholphin.ui.SlimItemFields
import com.github.damontecres.wholphin.ui.cards.SeasonCard import com.github.damontecres.wholphin.ui.cards.SeasonCard
import com.github.damontecres.wholphin.ui.components.ErrorMessage import com.github.damontecres.wholphin.ui.components.ErrorMessage
import com.github.damontecres.wholphin.ui.components.ExpandableFaButton import com.github.damontecres.wholphin.ui.components.ExpandableFaButton
@ -180,7 +181,7 @@ class PersonViewModel
GetItemsRequest( GetItemsRequest(
personIds = listOf(itemId), personIds = listOf(itemId),
includeItemTypes = listOf(type), includeItemTypes = listOf(type),
fields = SlimItemFields, fields = ItemRowFields,
recursive = true, recursive = true,
sortBy = listOf(ItemSortBy.PREMIERE_DATE, ItemSortBy.PRODUCTION_YEAR, ItemSortBy.SORT_NAME), sortBy = listOf(ItemSortBy.PREMIERE_DATE, ItemSortBy.PRODUCTION_YEAR, ItemSortBy.SORT_NAME),
sortOrder = listOf(SortOrder.DESCENDING, SortOrder.DESCENDING, SortOrder.ASCENDING), sortOrder = listOf(SortOrder.DESCENDING, SortOrder.DESCENDING, SortOrder.ASCENDING),
@ -409,6 +410,7 @@ fun PersonPageContent(
}, },
onLongClick = onLongClick, onLongClick = onLongClick,
imageHeight = Cards.heightEpisode, imageHeight = Cards.heightEpisode,
aspectRatio = item?.aspectRatio ?: AspectRatios.FOUR_THREE,
modifier = modifier =
mod mod
.ifElse( .ifElse(

View file

@ -54,7 +54,12 @@ fun SongListItem(
isQueued: Boolean = false, isQueued: Boolean = false,
) = SongListItem( ) = SongListItem(
title = song?.title, title = song?.title,
artist = if (showArtist) song?.data?.albumArtist else null, artist =
if (showArtist) {
remember(song) { song?.data?.artists?.joinToString(", ") }
} else {
null
},
indexNumber = song?.data?.indexNumber, indexNumber = song?.data?.indexNumber,
runtime = runtime =
remember(song) { remember(song) {