From 95e23875f4e2761a8ed65d73dd5b94977e0d0d79 Mon Sep 17 00:00:00 2001 From: viown <48097677+viown@users.noreply.github.com> Date: Sat, 5 Oct 2024 09:56:06 +0300 Subject: [PATCH] Only specify mediaSourceId if index changed --- src/components/playback/playbackmanager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index f19bb51e53..3dfa961856 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -2573,7 +2573,7 @@ export class PlaybackManager { } const apiClient = ServerConnections.getApiClient(item.ServerId); - const mediaSourceId = playOptions.mediaSourceId; + let mediaSourceId = playOptions.mediaSourceId; const getMediaStreams = apiClient.getItem(apiClient.getCurrentUserId(), mediaSourceId || item.Id) .then(fullItem => { return fullItem.MediaStreams; @@ -2611,9 +2611,11 @@ export class PlaybackManager { autoSetNextTracks(prevSource, mediaStreams, trackOptions, user.Configuration.RememberAudioSelections, user.Configuration.RememberSubtitleSelections); if (trackOptions.DefaultAudioStreamIndex != null) { options.audioStreamIndex = trackOptions.DefaultAudioStreamIndex; + mediaSourceId = mediaSourceId || item.Id; } if (trackOptions.DefaultSubtitleStreamIndex != null) { options.subtitleStreamIndex = trackOptions.DefaultSubtitleStreamIndex; + mediaSourceId = mediaSourceId || item.Id; } return getPlaybackMediaSource(player, apiClient, deviceProfile, item, mediaSourceId, options).then(async (mediaSource) => {