Merge pull request #2342 from OancaAndrei/syncplay-clear-queue

Clear playlist in SyncPlay group
This commit is contained in:
dkanada 2021-09-07 01:20:33 +09:00 committed by GitHub
commit 936f29a836
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 2 deletions

View file

@ -100,6 +100,18 @@ class Controller {
});
}
/**
* Clears the playlist of a SyncPlay group.
* @param {Array} clearPlayingItem Whether to remove the playing item as well.
*/
clearPlaylist(clearPlayingItem = false) {
const apiClient = this.manager.getApiClient();
apiClient.requestSyncPlayRemoveFromPlaylist({
ClearPlaylist: true,
ClearPlayingItem: clearPlayingItem
});
}
/**
* Removes items from SyncPlay group playlist.
* @param {Array} playlistItemIds The items to remove.

View file

@ -78,8 +78,7 @@ export function getItemsForPlayback(apiClient, query) {
return apiClient.getItem(apiClient.getCurrentUserId(), itemId).then(function (item) {
return {
Items: [item],
TotalRecordCount: 1
Items: [item]
};
});
} else {