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 =
userPreferences.appPreferences.interfacePreferences.screensaverPreference.dimPercent / 100f
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
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)),
)
}
}
}
}
}

View file

@ -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")

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.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(

View file

@ -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) {