Fix subtitle smart mode to check chosen audio language (#420)

Fixes how the smart subtitle mode logic works

Fixes #406
This commit is contained in:
damontecres 2025-12-11 12:52:21 -05:00 committed by GitHub
parent 319b46983f
commit c5c0dff705
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 50 additions and 25 deletions

View file

@ -366,26 +366,26 @@ class PlaybackViewModel
?.sortedWith(compareBy<AudioStream> { it.language }.thenByDescending { it.channels })
.orEmpty()
val audioIndex =
val audioStream =
streamChoiceService
.chooseStream(
mediaSource,
base.seriesId,
playbackConfig,
plc,
MediaStreamType.AUDIO,
preferences,
)?.index
.chooseAudioStream(
source = mediaSource,
seriesId = base.seriesId,
itemPlayback = playbackConfig,
plc = plc,
prefs = preferences,
)
val audioIndex = audioStream?.index
val subtitleIndex =
streamChoiceService
.chooseStream(
mediaSource,
base.seriesId,
playbackConfig,
plc,
MediaStreamType.SUBTITLE,
preferences,
.chooseSubtitleStream(
source = mediaSource,
audioStream = audioStream,
seriesId = base.seriesId,
itemPlayback = playbackConfig,
plc = plc,
prefs = preferences,
)?.index
Timber.d("Selected mediaSource=${mediaSource.id}, audioIndex=$audioIndex, subtitleIndex=$subtitleIndex")