Skip to content

Commit

Permalink
Remove invalid item id usage as media source id
Browse files Browse the repository at this point in the history
Looking at the change history, it looks like an accidental ` || item.Id`
was introduced in 4c31742 to query for
the item, perhaps not realising it is later used in the query later on
for server-side filtering. This was partially fixed by
c54db60 and
ca47635 for Live TV by not setting this
variable in that case.
  • Loading branch information
Kevinjil committed Dec 17, 2024
1 parent 052eb6d commit 86bb958
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/playback/playbackmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2581,15 +2581,10 @@ export class PlaybackManager {
}

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

const mediaSourceId = playOptions.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;
});
Expand Down

0 comments on commit 86bb958

Please sign in to comment.