Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove invalid item id usage as media source id #6396

Open
wants to merge 1 commit into
base: release-10.10.z
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/components/playback/playbackmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2603,16 +2603,11 @@ export class PlaybackManager {
});
}

const apiClient = ServerConnections.getApiClient(item.ServerId);
let mediaSourceId;
let mediaSourceId = playOptions.mediaSourceId;

const apiClient = ServerConnections.getApiClient(item.ServerId);
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;
});
Expand Down Expand Up @@ -2645,13 +2640,20 @@ export class PlaybackManager {
playOptions.items = null;

const trackOptions = {};
let needsTrackWorkaround = false;

autoSetNextTracks(prevSource, mediaStreams, trackOptions, user.Configuration.RememberAudioSelections, user.Configuration.RememberSubtitleSelections);
if (trackOptions.DefaultAudioStreamIndex != null) {
options.audioStreamIndex = trackOptions.DefaultAudioStreamIndex;
needsTrackWorkaround = true;
}
if (trackOptions.DefaultSubtitleStreamIndex != null) {
options.subtitleStreamIndex = trackOptions.DefaultSubtitleStreamIndex;
needsTrackWorkaround = true;
}

if (needsTrackWorkaround) {
mediaSourceId ||= item.Id;
}

return getPlaybackMediaSource(player, apiClient, deviceProfile, item, mediaSourceId, options).then(async (mediaSource) => {
Expand Down
Loading