mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #6396 from Kevinjil/fix-mediasourceid
Remove invalid item id usage as media source id
This commit is contained in:
commit
4793223f5d
1 changed files with 10 additions and 8 deletions
|
@ -2602,16 +2602,11 @@ export class PlaybackManager {
|
|||
});
|
||||
}
|
||||
|
||||
let mediaSourceId = playOptions.mediaSourceId;
|
||||
|
||||
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
||||
let mediaSourceId;
|
||||
|
||||
const isLiveTv = [BaseItemKind.TvChannel, BaseItemKind.LiveTvChannel].includes(item.Type);
|
||||
|
||||
if (!isLiveTv) {
|
||||
mediaSourceId = playOptions.mediaSourceId || item.Id;
|
||||
}
|
||||
|
||||
const getMediaStreams = isLiveTv ? Promise.resolve([]) : apiClient.getItem(apiClient.getCurrentUserId(), mediaSourceId)
|
||||
const getMediaStreams = isLiveTv ? Promise.resolve([]) : apiClient.getItem(apiClient.getCurrentUserId(), mediaSourceId || item.Id)
|
||||
.then(fullItem => {
|
||||
return fullItem.MediaStreams;
|
||||
});
|
||||
|
@ -2644,13 +2639,20 @@ export class PlaybackManager {
|
|||
playOptions.items = null;
|
||||
|
||||
const trackOptions = {};
|
||||
let isIdFallbackNeeded = false;
|
||||
|
||||
autoSetNextTracks(prevSource, mediaStreams, trackOptions, user.Configuration.RememberAudioSelections, user.Configuration.RememberSubtitleSelections);
|
||||
if (trackOptions.DefaultAudioStreamIndex != null) {
|
||||
options.audioStreamIndex = trackOptions.DefaultAudioStreamIndex;
|
||||
isIdFallbackNeeded = true;
|
||||
}
|
||||
if (trackOptions.DefaultSubtitleStreamIndex != null) {
|
||||
options.subtitleStreamIndex = trackOptions.DefaultSubtitleStreamIndex;
|
||||
isIdFallbackNeeded = true;
|
||||
}
|
||||
|
||||
if (isIdFallbackNeeded) {
|
||||
mediaSourceId ||= item.Id;
|
||||
}
|
||||
|
||||
return getPlaybackMediaSource(player, apiClient, deviceProfile, item, mediaSourceId, options).then(async (mediaSource) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue