@@ -2602,16 +2602,11 @@ export class PlaybackManager {
2602
2602
} ) ;
2603
2603
}
2604
2604
2605
- const apiClient = ServerConnections . getApiClient ( item . ServerId ) ;
2606
- let mediaSourceId ;
2605
+ let mediaSourceId = playOptions . mediaSourceId ;
2607
2606
2607
+ const apiClient = ServerConnections . getApiClient ( item . ServerId ) ;
2608
2608
const isLiveTv = [ BaseItemKind . TvChannel , BaseItemKind . LiveTvChannel ] . includes ( item . Type ) ;
2609
-
2610
- if ( ! isLiveTv ) {
2611
- mediaSourceId = playOptions . mediaSourceId || item . Id ;
2612
- }
2613
-
2614
- const getMediaStreams = isLiveTv ? Promise . resolve ( [ ] ) : apiClient . getItem ( apiClient . getCurrentUserId ( ) , mediaSourceId )
2609
+ const getMediaStreams = isLiveTv ? Promise . resolve ( [ ] ) : apiClient . getItem ( apiClient . getCurrentUserId ( ) , mediaSourceId || item . Id )
2615
2610
. then ( fullItem => {
2616
2611
return fullItem . MediaStreams ;
2617
2612
} ) ;
@@ -2644,13 +2639,20 @@ export class PlaybackManager {
2644
2639
playOptions . items = null ;
2645
2640
2646
2641
const trackOptions = { } ;
2642
+ let isIdFallbackNeeded = false ;
2647
2643
2648
2644
autoSetNextTracks ( prevSource , mediaStreams , trackOptions , user . Configuration . RememberAudioSelections , user . Configuration . RememberSubtitleSelections ) ;
2649
2645
if ( trackOptions . DefaultAudioStreamIndex != null ) {
2650
2646
options . audioStreamIndex = trackOptions . DefaultAudioStreamIndex ;
2647
+ isIdFallbackNeeded = true ;
2651
2648
}
2652
2649
if ( trackOptions . DefaultSubtitleStreamIndex != null ) {
2653
2650
options . subtitleStreamIndex = trackOptions . DefaultSubtitleStreamIndex ;
2651
+ isIdFallbackNeeded = true ;
2652
+ }
2653
+
2654
+ if ( isIdFallbackNeeded ) {
2655
+ mediaSourceId ||= item . Id ;
2654
2656
}
2655
2657
2656
2658
return getPlaybackMediaSource ( player , apiClient , deviceProfile , item , mediaSourceId , options ) . then ( async ( mediaSource ) => {
0 commit comments