mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
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:
parent
319b46983f
commit
c5c0dff705
3 changed files with 50 additions and 25 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue