1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Backport pull request #6396 from jellyfin-web/release-10.10.z

Remove invalid item id usage as media source id

Original-merge: 4793223f5d

Merged-by: thornbill <thornbill@users.noreply.github.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
Kevinjil 2025-02-03 12:29:40 -05:00 committed by Joshua M. Boniface
parent 4eb578b39e
commit aa33101e1d

View file

@ -2609,16 +2609,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;
});
@ -2651,13 +2646,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) => {