Started work on queue panel
This commit is contained in:
parent
4f6b3318a0
commit
42c20455e5
16 changed files with 342 additions and 14 deletions
|
|
@ -136,8 +136,11 @@ module.exports = class{
|
|||
}
|
||||
});
|
||||
|
||||
//Get schedule as a temporary array
|
||||
const queue = Array.from(this.channel.queue.schedule);
|
||||
|
||||
//Send off the metadata to our user's clients
|
||||
this.emit("clientMetadata", {user: userObj, flairList});
|
||||
this.emit("clientMetadata", {user: userObj, flairList, queue});
|
||||
}
|
||||
|
||||
async sendSiteEmotes(){
|
||||
|
|
|
|||
|
|
@ -18,9 +18,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
const crypto = require('node:crypto');
|
||||
|
||||
module.exports = class{
|
||||
constructor(title, fileName, id, type, duration){
|
||||
constructor(title, fileName, url, id, type, duration){
|
||||
this.title = title;
|
||||
this.fileName = fileName
|
||||
this.url = url;
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
this.duration = duration;
|
||||
|
|
|
|||
|
|
@ -156,6 +156,9 @@ module.exports = class{
|
|||
|
||||
//Replace the existing schedule map with our new one
|
||||
this.schedule = newSchedule;
|
||||
|
||||
//Broadcast the channel queue
|
||||
this.broadcastQueue();
|
||||
}
|
||||
|
||||
start(mediaObj){
|
||||
|
|
@ -285,4 +288,8 @@ module.exports = class{
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
broadcastQueue(){
|
||||
this.server.io.in(this.channel.name).emit('queue',{queue: Array.from(this.schedule)})
|
||||
}
|
||||
}
|
||||
|
|
@ -18,9 +18,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
const media = require('./media');
|
||||
|
||||
module.exports = class extends media{
|
||||
constructor(title, fileName, id, type, duration, startTime){
|
||||
constructor(title, fileName, url, id, type, duration, startTime){
|
||||
//Call derived constructor
|
||||
super(title, fileName, id, type, duration);
|
||||
super(title, fileName, url, id, type, duration);
|
||||
//Set media start time
|
||||
this.startTime = startTime;
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ module.exports = class extends media{
|
|||
//statics
|
||||
static fromMedia(media, startTime){
|
||||
//Create and return queuedMedia object from given media object and arguments
|
||||
return new this(media.title, media.fileName, media.id, media.type, media.duration, startTime);
|
||||
return new this(media.title, media.fileName, media.url, media.id, media.type, media.duration, startTime);
|
||||
}
|
||||
|
||||
//methods
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue