Various minor bug fixes (#1707)
## Description Gathering several small bug fixes: - Clear the backdrop when manually reloading the home page - Convert the "# years old" string resource to plural - Fix a spelling error in the source English strings - Ensure #1680 is respected when searching for subtitles to download - Slightly adjust padding for the header in collection details to match other headers ### Related issues Fixes string issues reported in https://github.com/damontecres/Wholphin/issues/1705#issuecomment-4982909931 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
3cc2bf2dd1
commit
35c4d13f8f
35 changed files with 147 additions and 67 deletions
|
|
@ -25,7 +25,7 @@ fun HiddenFocusBox(
|
|||
modifier =
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.height(1.dp)
|
||||
.height(0.dp)
|
||||
.focusRequester(focusRequester)
|
||||
.onFocusChanged {
|
||||
if (it.isFocused) onFocus.invoke()
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import androidx.compose.ui.focus.FocusRequester
|
|||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.focus.onFocusChanged
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.pluralStringResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
|
@ -503,8 +504,9 @@ fun PersonHeader(
|
|||
val text =
|
||||
if (age != null) {
|
||||
stringResource(R.string.born) + ": ${formatDate(it)} (${
|
||||
stringResource(
|
||||
R.string.years_old,
|
||||
pluralStringResource(
|
||||
R.plurals.years_old,
|
||||
age,
|
||||
age,
|
||||
)
|
||||
})"
|
||||
|
|
@ -533,8 +535,9 @@ fun PersonHeader(
|
|||
val text =
|
||||
if (age != null) {
|
||||
stringResource(R.string.died) + ": ${formatDate(it)} (${
|
||||
stringResource(
|
||||
R.string.years_old,
|
||||
pluralStringResource(
|
||||
R.plurals.years_old,
|
||||
age,
|
||||
age,
|
||||
)
|
||||
})"
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ fun CollectionDetailsContent(
|
|||
modifier =
|
||||
Modifier
|
||||
.padding(
|
||||
start = HeaderUtils.startPadding,
|
||||
top = HeaderUtils.topPadding,
|
||||
bottom = 8.dp,
|
||||
).height(HeaderUtils.height),
|
||||
|
|
|
|||
|
|
@ -432,6 +432,7 @@ fun NavDrawer(
|
|||
viewModel.setIndex(HOME_INDEX)
|
||||
if (destination is Destination.Home) {
|
||||
viewModel.navigationManager.reloadHome()
|
||||
onClearBackdrop.invoke()
|
||||
} else {
|
||||
viewModel.navigationManager.goToHome()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ class PlaybackViewModel
|
|||
private val _state = MutableStateFlow(PlaybackState())
|
||||
val state: StateFlow<PlaybackState> = _state
|
||||
|
||||
private lateinit var preferences: UserPreferences
|
||||
internal lateinit var preferences: UserPreferences
|
||||
internal lateinit var itemId: UUID
|
||||
internal lateinit var currentItem: PlaylistItem
|
||||
internal var forceTranscoding: Boolean = false
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.github.damontecres.wholphin.R
|
|||
import com.github.damontecres.wholphin.data.model.BaseItem
|
||||
import com.github.damontecres.wholphin.data.model.PlaylistItem
|
||||
import com.github.damontecres.wholphin.data.model.TrackIndex
|
||||
import com.github.damontecres.wholphin.services.getPreferredLanguage
|
||||
import com.github.damontecres.wholphin.ui.isNotNullOrBlank
|
||||
import com.github.damontecres.wholphin.ui.launchIO
|
||||
import com.github.damontecres.wholphin.ui.onMain
|
||||
|
|
@ -42,15 +43,17 @@ sealed interface SubtitleSearchStatus {
|
|||
/**
|
||||
* Trigger a search for subtitles in the given language for the currently playing media
|
||||
*/
|
||||
fun PlaybackViewModel.searchForSubtitles(
|
||||
language: String =
|
||||
serverRepository
|
||||
.currentUserDto
|
||||
?.configuration
|
||||
?.subtitleLanguagePreference
|
||||
?.takeIf { it.isNotNullOrBlank() }
|
||||
?: Locale.current.language,
|
||||
) {
|
||||
fun PlaybackViewModel.searchForSubtitles(language: String? = null) {
|
||||
val language =
|
||||
language ?: getPreferredLanguage(
|
||||
MediaStreamType.SUBTITLE,
|
||||
preferences,
|
||||
serverRepository
|
||||
.currentUserDto
|
||||
?.configuration,
|
||||
)?.takeIf { it.isNotNullOrBlank() }
|
||||
?: Locale.current.language
|
||||
|
||||
subtitleSearchState.update {
|
||||
it.copy(
|
||||
status = SubtitleSearchStatus.Searching,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue