mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Always save series audio & subtitle preferences regardless of preferred languages (#473)
## Description This PR adjust the logic for audio & subtitle track selection for TV series. Instead of only saving for future episodes if the newly selected track is a different language than the user's preferred, always save it. Basically this means if you change the audio or subtitle language for an episode, the same audio or subtitle language will be used for future episodes (if available). Also, fixes the "default" subtitle mode to take the user's preferred language into consideration. ## Issues Follow up to https://github.com/damontecres/Wholphin/issues/378 & https://github.com/damontecres/Wholphin/issues/427 Fixes #469
This commit is contained in:
parent
ab8bbf2bd7
commit
ebfc00c016
2 changed files with 29 additions and 35 deletions
|
|
@ -134,9 +134,8 @@ class ItemPlaybackRepository
|
|||
val seriesId = item.data.seriesId
|
||||
if (seriesId != null && trackIndex != TrackIndex.UNSPECIFIED) {
|
||||
if (type == MediaStreamType.AUDIO) {
|
||||
val audioLang = current.userDto.configuration?.audioLanguagePreference
|
||||
val stream = source.mediaStreams?.first { it.index == trackIndex }
|
||||
if (stream?.language != null && stream.language != audioLang) {
|
||||
if (stream?.language != null) {
|
||||
streamChoiceService.updateAudio(item.data, stream.language!!)
|
||||
}
|
||||
} else if (type == MediaStreamType.SUBTITLE) {
|
||||
|
|
@ -147,10 +146,8 @@ class ItemPlaybackRepository
|
|||
subtitlesDisabled = true,
|
||||
)
|
||||
} else {
|
||||
val subtitleLang =
|
||||
current.userDto.configuration?.subtitleLanguagePreference
|
||||
val stream = source.mediaStreams?.first { it.index == trackIndex }
|
||||
if (stream?.language != null && stream.language != subtitleLang) {
|
||||
if (stream?.language != null) {
|
||||
streamChoiceService.updateSubtitles(
|
||||
item.data,
|
||||
stream.language!!,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue