diff --git a/src/app/channel/connectedUser.js b/src/app/channel/connectedUser.js
index 431c10a..a7248c9 100644
--- a/src/app/channel/connectedUser.js
+++ b/src/app/channel/connectedUser.js
@@ -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(){
diff --git a/src/app/channel/media/media.js b/src/app/channel/media/media.js
index ddf1f3d..97dfeee 100644
--- a/src/app/channel/media/media.js
+++ b/src/app/channel/media/media.js
@@ -18,9 +18,10 @@ along with this program. If not, see .*/
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;
diff --git a/src/app/channel/media/queue.js b/src/app/channel/media/queue.js
index 27ebf38..107119d 100644
--- a/src/app/channel/media/queue.js
+++ b/src/app/channel/media/queue.js
@@ -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)})
+ }
}
\ No newline at end of file
diff --git a/src/app/channel/media/queuedMedia.js b/src/app/channel/media/queuedMedia.js
index 4dc015d..71525af 100644
--- a/src/app/channel/media/queuedMedia.js
+++ b/src/app/channel/media/queuedMedia.js
@@ -18,9 +18,9 @@ along with this program. If not, see .*/
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
diff --git a/src/controllers/panel/queueController.js b/src/controllers/panel/queueController.js
new file mode 100644
index 0000000..295ff4c
--- /dev/null
+++ b/src/controllers/panel/queueController.js
@@ -0,0 +1,20 @@
+/*Canopy - The next generation of stoner streaming software
+Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see .*/
+
+//root index functions
+module.exports.get = async function(req, res){
+ res.render('partial/panels/queue', {});
+}
\ No newline at end of file
diff --git a/src/routers/panelRouter.js b/src/routers/panelRouter.js
index 908cdbd..0efba65 100644
--- a/src/routers/panelRouter.js
+++ b/src/routers/panelRouter.js
@@ -23,6 +23,7 @@ const placeholderController = require("../controllers/panel/placeholderControlle
const emoteController = require("../controllers/panel/emoteController");
const popoutContainerController = require("../controllers/panel/popoutContainerController");
const profileController = require("../controllers/panel/profileController");
+const queueController = require("../controllers/panel/queueController");
//Validators
const accountValidator = require("../validators/accountValidator");
@@ -34,5 +35,6 @@ router.get('/placeholder', placeholderController.get);
router.get('/emote', emoteController.get);
router.get('/popoutContainer', popoutContainerController.get);
router.get('/profile', accountValidator.user(), profileController.get);
+router.get('/queue', queueController.get);
module.exports = router;
diff --git a/src/utils/media/yanker.js b/src/utils/media/yanker.js
index 790b5f2..638e0fa 100644
--- a/src/utils/media/yanker.js
+++ b/src/utils/media/yanker.js
@@ -40,7 +40,7 @@ module.exports.yankMedia = async function(url){
const link = `https://archive.org/download/${mediaInfo.metadata.identifier}/${file.name}`;
//Create new media object from file info
- mediaList.push(new media(name, name, link, 'ia', Number(file.length)));
+ mediaList.push(new media(name, name, link, link, 'ia', Number(file.length)));
}
//return media object list
diff --git a/src/views/channel.ejs b/src/views/channel.ejs
index 4f89406..f923223 100644
--- a/src/views/channel.ejs
+++ b/src/views/channel.ejs
@@ -32,17 +32,25 @@ along with this program. If not, see . %>