foo_spider_monkey_panel icon indicating copy to clipboard operation
foo_spider_monkey_panel copied to clipboard

SetPlaylistLockedActions blocks playback

Open regorxxx opened this issue 1 year ago • 1 comments

Using this method, whenever you lock a playlists (with any lock type), you can not play any of the tracks from it.


"use strict";

const lockedActions = ['AddItems','RemoveItems','ReorderItems','ReplaceItems','RenamePlaylist','RemovePlaylist','ExecuteDefaultAction',''];
function on_mouse_lbtn_up(x, y) {
    console.log(lockedActions[0] ? lockedActions[0] : 'no lock');
	plman.SetPlaylistLockedActions(plman.ActivePlaylist, lockedActions[0] ? [lockedActions[0]] : []);
    lockedActions.rotate(1);
}

Array.prototype.rotate = (function() {
	const unshift = Array.prototype.unshift, splice = Array.prototype.splice;
	return function(count) {
		const len = this.length >>> 0;
		count = count >> 0;
		unshift.apply(this, splice.call(this, count % len, len));
		return this;
	};
})();

Try it yourself, playback doesn't work except when the playlist is locked 'ExecuteDefaultAction' or no lock is used.

regorxxx avatar Jan 17 '23 18:01 regorxxx