mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #3467 from dmitrylyzo/fix-syncplay-promise
Return Promise from SyncPlay playRequest
This commit is contained in:
commit
8f29f6955b
2 changed files with 5 additions and 5 deletions
|
@ -71,7 +71,7 @@ class Controller {
|
||||||
const apiClient = this.manager.getApiClient();
|
const apiClient = this.manager.getApiClient();
|
||||||
const sendPlayRequest = (items) => {
|
const sendPlayRequest = (items) => {
|
||||||
const queue = items.map(item => item.Id);
|
const queue = items.map(item => item.Id);
|
||||||
apiClient.requestSyncPlaySetNewQueue({
|
return apiClient.requestSyncPlaySetNewQueue({
|
||||||
PlayingQueue: queue,
|
PlayingQueue: queue,
|
||||||
PlayingItemPosition: options.startIndex ? options.startIndex : 0,
|
PlayingItemPosition: options.startIndex ? options.startIndex : 0,
|
||||||
StartPositionTicks: options.startPositionTicks ? options.startPositionTicks : 0
|
StartPositionTicks: options.startPositionTicks ? options.startPositionTicks : 0
|
||||||
|
@ -79,12 +79,12 @@ class Controller {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (options.items) {
|
if (options.items) {
|
||||||
Helper.translateItemsForPlayback(apiClient, options.items, options).then(sendPlayRequest);
|
return Helper.translateItemsForPlayback(apiClient, options.items, options).then(sendPlayRequest);
|
||||||
} else {
|
} else {
|
||||||
Helper.getItemsForPlayback(apiClient, {
|
return Helper.getItemsForPlayback(apiClient, {
|
||||||
Ids: options.ids.join(',')
|
Ids: options.ids.join(',')
|
||||||
}).then(function (result) {
|
}).then(function (result) {
|
||||||
Helper.translateItemsForPlayback(apiClient, result.Items, options).then(sendPlayRequest);
|
return Helper.translateItemsForPlayback(apiClient, result.Items, options).then(sendPlayRequest);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,7 @@ class NoActivePlayer extends SyncPlay.Players.GenericPlayer {
|
||||||
*/
|
*/
|
||||||
playRequest(options) {
|
playRequest(options) {
|
||||||
const controller = syncPlayManager.getController();
|
const controller = syncPlayManager.getController();
|
||||||
controller.play(options);
|
return controller.play(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue