Skip to content

Commit

Permalink
Fix playback on playlists.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwalton3 committed Mar 24, 2021
1 parent 8fd19c9 commit 26a3756
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/shimPlayer/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class ShimPlayer {

async play(options) {
options = Object.assign({}, options);
const apiClient = getCurrentApiClient(this);

if (options.items) {
options.ids = options.items.map(function (i) {
Expand All @@ -180,15 +181,15 @@ class ShimPlayer {

// playbackManager doesn't resolve the queue for remote players.
// The server normally would.
const result = await playbackManager.getItemsForPlayback(options.serverId, {
const result = await playbackManager.getItemsForPlayback(options.serverId || apiClient.serverId(), {
Ids: options.ids.join(',')
});
const items = await playbackManager.translateItemsForPlayback(result.Items, options);
const ids = items.map((i) => i.Id);

options.ids = ids;

return await sendPlayCommand(getCurrentApiClient(this), options, 'PlayNow');
return await sendPlayCommand(apiClient, options, 'PlayNow');
}

shuffle(item) {
Expand Down

0 comments on commit 26a3756

Please sign in to comment.