Fixes a few bugs (#535)

## Description

A few minor bug fixes across the app

- Fix the language not showing after search on the subtitle search &
download dialog
- Clear the backdrop whenever the home page is reloading from scratch
- Enable pressing a remote's play (or play/pause) button on the series
page to play the focused episode

### Related issues
Play button follow up from #424
This commit is contained in:
Ray 2025-12-21 21:31:01 -05:00 committed by GitHub
parent 925a4b9d82
commit 60838c2a86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View file

@ -40,6 +40,7 @@ import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.focusRestorer import androidx.compose.ui.focus.focusRestorer
import androidx.compose.ui.focus.onFocusChanged import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.key.onKeyEvent
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -59,6 +60,7 @@ import com.github.damontecres.wholphin.ui.components.TabRow
import com.github.damontecres.wholphin.ui.formatDateTime import com.github.damontecres.wholphin.ui.formatDateTime
import com.github.damontecres.wholphin.ui.ifElse import com.github.damontecres.wholphin.ui.ifElse
import com.github.damontecres.wholphin.ui.logTab import com.github.damontecres.wholphin.ui.logTab
import com.github.damontecres.wholphin.ui.playback.isPlayKeyUp
import com.github.damontecres.wholphin.ui.tryRequestFocus import com.github.damontecres.wholphin.ui.tryRequestFocus
import com.github.damontecres.wholphin.ui.util.rememberDelayedNestedScroll import com.github.damontecres.wholphin.ui.util.rememberDelayedNestedScroll
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -249,6 +251,12 @@ fun SeriesOverviewContent(
bringIntoViewRequester.bringIntoView() bringIntoViewRequester.bringIntoView()
} }
} }
}.onKeyEvent {
if (episode != null && isPlayKeyUp(it)) {
onClick.invoke(episode)
return@onKeyEvent true
}
return@onKeyEvent false
}, },
interactionSource = interactionSource, interactionSource = interactionSource,
cardHeight = 120.dp, cardHeight = 120.dp,

View file

@ -91,6 +91,7 @@ class HomeViewModel
), ),
) { ) {
Timber.d("init HomeViewModel") Timber.d("init HomeViewModel")
backdropService.clearBackdrop()
serverRepository.currentUserDto.value?.let { userDto -> serverRepository.currentUserDto.value?.let { userDto ->
val includedIds = val includedIds =

View file

@ -107,7 +107,7 @@ fun DownloadSubtitlesContent(
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
) )
// val lang = rememberTextFieldState(language) // val lang = rememberTextFieldState(language)
var lang by rememberSaveable { mutableStateOf("") } var lang by rememberSaveable { mutableStateOf(language) }
Row( Row(
horizontalArrangement = Arrangement.spacedBy(8.dp), horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,