From 39523aa6e2176f18702cb9444184ab1a637557b5 Mon Sep 17 00:00:00 2001 From: Damontecres Date: Thu, 20 Aug 2026 17:09:39 -0400 Subject: [PATCH] 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 ## Screenshots ## AI or LLM usage --- .../damontecres/wholphin/MainContent.kt | 4 +- .../wholphin/WholphinDreamService.kt | 39 ++++++++++--------- .../wholphin/services/ScreensaverService.kt | 1 - .../wholphin/ui/detail/PersonPage.kt | 6 ++- .../ui/detail/music/SongListDisplay.kt | 7 +++- 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/com/github/damontecres/wholphin/MainContent.kt b/app/src/main/java/com/github/damontecres/wholphin/MainContent.kt index 25221874..26dda908 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/MainContent.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/MainContent.kt @@ -154,7 +154,9 @@ fun MainContent( val alpha = userPreferences.appPreferences.interfacePreferences.screensaverPreference.dimPercent / 100f Box( - Modifier.background(Color.Black.copy(alpha = alpha)), + Modifier + .fillMaxSize() + .background(Color.Black.copy(alpha = alpha)), ) } } diff --git a/app/src/main/java/com/github/damontecres/wholphin/WholphinDreamService.kt b/app/src/main/java/com/github/damontecres/wholphin/WholphinDreamService.kt index 41a87222..57d4a447 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/WholphinDreamService.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/WholphinDreamService.kt @@ -1,6 +1,8 @@ package com.github.damontecres.wholphin 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.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState @@ -9,7 +11,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue 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.datastore.core.DataStore import androidx.lifecycle.Lifecycle @@ -95,14 +97,6 @@ class WholphinDreamService : preferencesDataStore.data.collectLatest { prefs = it } } prefs?.let { prefs -> - val alpha = - prefs.interfacePreferences.screensaverPreference.run { - if (dimEnabled) { - dimPercent / 100f - } else { - 1f - } - } CoilConfig( prefs = prefs, okHttpClient = okHttpClient, @@ -113,16 +107,23 @@ class WholphinDreamService : ProvideLocalClock { val screensaverPrefs = prefs.interfacePreferences.screensaverPreference val currentItem by itemFlow.collectAsState(null) - AppScreensaverContent( - currentItem = currentItem, - showClock = screensaverPrefs.showClock, - duration = screensaverPrefs.duration.milliseconds, - animate = screensaverPrefs.animate, - modifier = - Modifier - .fillMaxSize() - .alpha(alpha = alpha), - ) + Box(Modifier.fillMaxSize()) { + AppScreensaverContent( + currentItem = currentItem, + showClock = screensaverPrefs.showClock, + duration = screensaverPrefs.duration.milliseconds, + animate = screensaverPrefs.animate, + modifier = Modifier.fillMaxSize(), + ) + if (screensaverPrefs.dimEnabled) { + val alpha = screensaverPrefs.dimPercent / 100f + Box( + Modifier + .fillMaxSize() + .background(Color.Black.copy(alpha = alpha)), + ) + } + } } } } diff --git a/app/src/main/java/com/github/damontecres/wholphin/services/ScreensaverService.kt b/app/src/main/java/com/github/damontecres/wholphin/services/ScreensaverService.kt index 90b0c04a..09aa29a8 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/services/ScreensaverService.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/services/ScreensaverService.kt @@ -85,7 +85,6 @@ class ScreensaverService * Reset the timer before showing the in-app screensaver */ fun pulse() { - Timber.v("state=%s", _state.value) waitJob?.cancel() if (_state.value.enabled) { // Timber.v("pulse") diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/detail/PersonPage.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/detail/PersonPage.kt index c7f9ee26..8c9b05de 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/detail/PersonPage.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/detail/PersonPage.kt @@ -46,10 +46,11 @@ import com.github.damontecres.wholphin.preferences.UserPreferences import com.github.damontecres.wholphin.services.FavoriteWatchManager import com.github.damontecres.wholphin.services.NavigationManager 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.ItemRowFields import com.github.damontecres.wholphin.ui.LocalImageUrlService 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.components.ErrorMessage import com.github.damontecres.wholphin.ui.components.ExpandableFaButton @@ -180,7 +181,7 @@ class PersonViewModel GetItemsRequest( personIds = listOf(itemId), includeItemTypes = listOf(type), - fields = SlimItemFields, + fields = ItemRowFields, recursive = true, sortBy = listOf(ItemSortBy.PREMIERE_DATE, ItemSortBy.PRODUCTION_YEAR, ItemSortBy.SORT_NAME), sortOrder = listOf(SortOrder.DESCENDING, SortOrder.DESCENDING, SortOrder.ASCENDING), @@ -409,6 +410,7 @@ fun PersonPageContent( }, onLongClick = onLongClick, imageHeight = Cards.heightEpisode, + aspectRatio = item?.aspectRatio ?: AspectRatios.FOUR_THREE, modifier = mod .ifElse( diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/detail/music/SongListDisplay.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/detail/music/SongListDisplay.kt index 3879cca4..e4664ac9 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/detail/music/SongListDisplay.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/detail/music/SongListDisplay.kt @@ -54,7 +54,12 @@ fun SongListItem( isQueued: Boolean = false, ) = SongListItem( 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, runtime = remember(song) {