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:
damontecres 2025-12-15 12:15:17 -05:00 committed by GitHub
parent ab8bbf2bd7
commit ebfc00c016
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 35 deletions

View file

@ -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!!,