1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add 'Clear Queue' option

This commit is contained in:
ferferga 2020-07-01 15:54:51 +02:00
parent 737341934a
commit 08a995fe2c
7 changed files with 50 additions and 13 deletions

View file

@ -84,6 +84,14 @@ define([], function () {
this._shuffleMode = 'Sorted';
};
PlayQueueManager.prototype.clearPlaylist = function (clearCurrentItem = false) {
const currentPlaylistItem = this._playlist.splice(this.getCurrentPlaylistIndex(), 1)[0];
this._playlist = [];
if (!clearCurrentItem) {
this._playlist.push(currentPlaylistItem);
}
};
function arrayInsertAt(destArray, pos, arrayToInsert) {
var args = [];
args.push(pos); // where to insert