Re-worked playlistHandler.js for site-wide playlist collections.

This commit is contained in:
rainbow napkin 2026-06-23 03:56:33 -04:00
parent 0b7f99725d
commit 7530b5fa5f
2 changed files with 210 additions and 114 deletions

View file

@ -580,6 +580,7 @@ class playlistManager{
event.target.parentNode.dataset['playlist'],
this.client,
this.queuePanel.ownerDoc,
event.target.parentNode.dataset['location'],
handleOpenedMedia.bind(this)
);
@ -870,9 +871,10 @@ class renamePopup{
* @param {String} playlist - Playlist name
* @param {channel} client - Parent Client Management Object
* @param {Document} doc - Current owner documnet of the panel, so we know where to drop our pop-up
* @param {String} location - Location of playlist, either Channel or User
* @param {Function} cb - Callback function, passed new name upon rename
*/
constructor(event, playlist, client, doc, cb){
constructor(event, playlist, client, doc, location, cb){
/**
* Parent Client Management Object
*/
@ -888,6 +890,11 @@ class renamePopup{
*/
this.cb = cb;
/**
* Location of playlist, either Channel or User
*/
this.location = location;
//Create media popup and call async constructor when done
//unfortunately we cant call constructors asyncronously, and we cant call back to this from super, so we can't extend this as it stands :(
/**
@ -924,7 +931,7 @@ class renamePopup{
if(event.key == null || event.key == "Enter"){
//Tell the server to change the titles
this.client.socket.emit('renameChannelPlaylist', {
this.client.socket.emit(`rename${this.location}Playlist`, {
playlist: this.playlist,
name: this.renamePrompt.value
});