Compare commits

..

22 commits

Author SHA1 Message Date
a07edfc842 Updated archivedMediaSchema to track channel by DB identifier instead of name. 2026-07-06 01:06:55 -04:00
0dda73cd14 Finished upgrade logic 2026-07-06 01:06:33 -04:00
d03e221891 Updated copyleft date 2026-07-05 22:27:41 -04:00
058ab2708a Fixed CSS link for 404 page. 2026-07-03 02:20:45 -04:00
3d853a3282 Merge changes in from Panama Red: Hotfix 4 2026-07-03 02:04:11 -04:00
70fc42b181 Removed playlist related functions from user and channel schemas. 2026-06-23 04:02:10 -04:00
7530b5fa5f Re-worked playlistHandler.js for site-wide playlist collections. 2026-06-23 03:56:33 -04:00
0b7f99725d Started work on updating playlistHandler.js for dedicated/individual userPlaylist and channelPlaylist document collections. 2026-06-20 03:31:14 -04:00
36ae90b7af Started work on dedicated channel/user playlist models. 2026-06-04 00:18:36 -04:00
c5c484b8c1 Re-organized playlist schemas. 2026-06-04 00:18:12 -04:00
3ca91288d2 Fixed post-crash recovery for actively livestreaming channels. 2026-06-03 23:25:55 -04:00
ee47e1b844 Updated removeMedia() function to remove archived media from site-wide media archive. 2026-05-30 09:29:22 -04:00
ae294b3f78 Updated prepQueue function to pull from site-wide archive colleciton. Started work on updating removeMedia function. 2026-05-30 08:40:19 -04:00
bbb3576a7d Fixed dumpQueue debug function to return data from site-wide archived collection. 2026-05-29 20:08:50 -04:00
ea882bb3c3 Merge branch 'dev' of https://git.ourfore.st/rainbownapkin/canopy into dev 2026-05-29 19:10:01 -04:00
9cfe271323 fixed tiny bug in channel.css 2026-05-29 19:09:54 -04:00
c6d2316ebb Update contributing.md 2026-05-29 08:23:28 -04:00
dac9631f60 Add contributing.md 2026-05-29 08:21:53 -04:00
4dbc5b69cf Updated queue to save archived media to site-wide collection 2026-05-29 08:06:46 -04:00
855343dfc3 Started work on archived media collection. 2026-05-29 07:18:06 -04:00
8d7d08d5c0 Added basic version tracking to statistics document. 2026-05-29 06:35:22 -04:00
a01d94a57e Jump version number 2026-05-21 20:20:25 -04:00
258 changed files with 1378 additions and 713 deletions

View file

@ -1,4 +1,4 @@
All Original Canopy Code is Covered under the Gnu Affero General Public License v3 - 2024 - 2025 Rainbownapkin All Original Canopy Code is Covered under the Gnu Affero General Public License v3 - 2024 - 2026 Rainbownapkin
GNU AFFERO GENERAL PUBLIC LICENSE GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007 Version 3, 19 November 2007

View file

@ -9,7 +9,7 @@ Canopy
<a href="https://git.ourfore.st/rainbownapkin/canopy/issues" target="_blank"><img src="https://git.ourfore.st/rainbownapkin/canopy/badges/issues/closed.svg"></a> <a href="https://git.ourfore.st/rainbownapkin/canopy/issues" target="_blank"><img src="https://git.ourfore.st/rainbownapkin/canopy/badges/issues/closed.svg"></a>
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html" target="_blank"><img src="https://img.shields.io/badge/License-AGPL_v3-663366.svg"></a> <a href="https://www.gnu.org/licenses/agpl-3.0.en.html" target="_blank"><img src="https://img.shields.io/badge/License-AGPL_v3-663366.svg"></a>
0.1-Alpha (Panama Red) - Hotfix 4 0.2-Alpha (Durban Poison)
========= =========
Canopy - /ˈkæ.nə.pi/: Canopy - /ˈkæ.nə.pi/:

9
contributing.md Normal file
View file

@ -0,0 +1,9 @@
We're a pretty small and informal community, so I think I can make this small and informal:
- Registration on git.ourfore.st is locked for anti-bot reasons. Bug bowie if you want access.
- Start a new branch either here or on another gitforge (preferably https://codeburg.org), and submit a PR
- Don't feel the need to limit yourself to already open issues, those are simply my current goals. Feel free to fuck around and make cool shit.
- No stolen and/or LLM-Generated code
- Thank you and much love for peeking at, using, and maybe even contributing to Canopy! <3
-Bowie

View file

@ -1,7 +1,7 @@
{ {
"name": "canopy-of-alpha", "name": "canopy-of-alpha",
"version": "0.1.4", "version": "0.2.0",
"canopyDisplayVersion": "0.1-Alpha (Panama Red) - Hotfix 4", "canopyDisplayVersion": "0.2-Alpha (Durban Poison)",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"dependencies": { "dependencies": {
"@braintree/sanitize-url": "^7.1.1", "@braintree/sanitize-url": "^7.1.1",

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -47,6 +47,11 @@ class activeChannel{
*/ */
this.tokeCommands = chanDB.tokeCommands; this.tokeCommands = chanDB.tokeCommands;
/**
* Internal Database Identifier for the channel
*/
this._id = chanDB._id;
/** /**
* List of connected users * List of connected users
*/ */

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -54,6 +54,11 @@ class connectedUser{
*/ */
this.highLevel = userDB.highLevel; this.highLevel = userDB.highLevel;
/**
* Internal Database Identifier for the user
*/
this._id = userDB._id;
//Check to make sure users flair entry from DB is good //Check to make sure users flair entry from DB is good
if(userDB.flair != null){ if(userDB.flair != null){
//Set flair from DB //Set flair from DB

View file

@ -0,0 +1,135 @@
/*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2026 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 <https://www.gnu.org/licenses/>.*/
//Local Imports
const media = require('./media');
const queuedMedia = require('./queuedMedia');
/**
* Class extending media which represents a queued piece of media
* @extends media
*/
class archivedMedia extends queuedMedia{
/**
* Creates a new queued media object
* @param {String} channel - Channel where object was queued
*/
constructor(title, fileName, url, id, type, duration, rawLink, startTime, startTimeStamp = 0, earlyEnd, uuid, channel){
//Call derived constructor
super(title, fileName, url, id, type, duration, rawLink, startTime, startTimeStamp, earlyEnd, uuid);
/**
* Channel media was queued
*/
this.channel = channel;
/**
* Media status type
*/
this.status = 'archived';
}
//statics
/**
* Creates a archivedMedia object from a media object
* @param {String} channel - Channel where object was queued
* @returns {archivedMedia} queuedMedia object created from given media object
*/
static fromMedia(media, startTime, startTimeStamp, channel){
//Create and return queuedMedia object from given media object and arguments
return new this(
media.title,
media.fileName,
media.url,
media.id,
media.type,
media.duration,
media.rawLink,
startTime,
startTimeStamp,
null,
null,
channel);
}
/**
* Creates a archivedMedia object from a queuedMedia object
* @param {String} channel - Channel where object was queued
* @returns {archivedMedia} queuedMedia object created from given media object
*/
static fromQueuedMedia(media, channel){
//Create and return queuedMedia object from given media object and arguments
return new this(
media.title,
media.fileName,
media.url,
media.id,
media.type,
media.duration,
media.rawLink,
media.startTime,
media.startTimeStamp,
media.earlyEnd,
media.uuid,
channel);
}
/**
* Converts array of media objects into array of archivedMedia objects
* @param {String} channel - Channel where object was queued
* @returns Array of converted queued media objects
*/
static fromMediaArray(mediaList, start, channel){
//Queued Media List
const archivedMediaList = [];
//Start Time Offset
let startOffset = 0;
for(let media of mediaList){
//Convert mediaObj to queuedMedia and push to the back of the list
archivedMediaList.push(this.fromMedia(media, start + startOffset, 0, channel));
//Set start offset to end of the current item
startOffset += (media.duration * 1000) + 5;
}
return archivedMediaList;
}
//methods
/**
* Generates a unique clone of a given media object
* @returns unique clone of media object
*/
clone(){
return new archivedMedia(
this.title,
this.fileName,
this.url,
this.id,
this.type,
this.duration,
this.rawLink,
this.startTime,
this.startTimeStamp,
this.earlyEnd,
null,
this.channel
);
}
}
module.exports = archivedMedia;

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -16,14 +16,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
//NPM imports //NPM imports
const validator = require('validator'); const validator = require('validator');
const mongoose = require('mongoose');
const { BSON } = require('mongodb');
//Local imports //Local imports
const config = require('../../../../config.json'); const config = require('../../../../config.json');
const queuedMedia = require('./queuedMedia'); const queuedMedia = require('./queuedMedia');
const archivedMedia = require('./archivedMedia');
const yanker = require('../../../utils/media/yanker'); const yanker = require('../../../utils/media/yanker');
const loggerUtils = require('../../../utils/loggerUtils'); const loggerUtils = require('../../../utils/loggerUtils');
const channelModel = require('../../../schemas/channel/channelSchema'); const channelModel = require('../../../schemas/channel/channelSchema');
const permissionModel = require('../../../schemas/permissionSchema'); const permissionModel = require('../../../schemas/permissionSchema');
const archivedMediaModel = require('../../../schemas/channel/media/archivedMediaSchema');
/** /**
* Object represneting a single channel's media queue * Object represneting a single channel's media queue
@ -422,6 +426,8 @@ class queue{
if(data != null && data.full){ if(data != null && data.full){
//Pull the channel DB doc //Pull the channel DB doc
const chanDB = await channelModel.findOne({name:this.channel.name}); const chanDB = await channelModel.findOne({name:this.channel.name});
//Pull archived media by channel name
const archived = await this.getArchive();
//Cook and emit a new object from all of the data //Cook and emit a new object from all of the data
socket.emit("dumpQueue", { socket.emit("dumpQueue", {
@ -432,7 +438,7 @@ class queue{
DB: { DB: {
schedule: chanDB.media.scheduled, schedule: chanDB.media.scheduled,
nowPlaying: chanDB.media.nowPlaying, nowPlaying: chanDB.media.nowPlaying,
archived: chanDB.media.archived, archived,
} }
}); });
@ -767,31 +773,14 @@ class queue{
//Get requested media //Get requested media
const media = this.getItemByUUID(uuid); const media = this.getItemByUUID(uuid);
//If we got a bad request //If we couldn't find anything in the current channel schedule
if(media == null){ if(media == null){
try{ try{
//If we wheren't handed a channel //Attempt to delete matching item from archived media
if(chanDB == null){ const deletedArchive = await archivedMediaModel.deleteOne({channel: this.channel._id, uuid: new BSON.UUID(uuid)});
//DO everything ourselves since we don't have a fance end() function to do it
chanDB = await channelModel.findOne({name:this.channel.name});
}
//If we couldn't find the channel //if nothing got deleted
if(chanDB == null){ if(deletedArchive == null || deletedArchive.deletedCount == 0){
//FUCK
throw loggerUtils.exceptionSmith(`Unable to find channel document ${this.channel.name} while queue item!`, "queue");
}
//Keep a copy of the archive that hasn't been changed
const preArchive = chanDB.media.archived;
//Filter out the requested item from the archive
chanDB.media.archived = chanDB.media.archived.filter((record)=>{
return record.uuid.toString() != uuid;
})
//If nothing changed in the archive
if(preArchive.length == chanDB.media.archived.length){
//If an originating socket was provided for this request //If an originating socket was provided for this request
if(socket != null){ if(socket != null){
//Yell at the user for being an asshole //Yell at the user for being an asshole
@ -802,13 +791,7 @@ class queue{
//If broadcasting is enabled //If broadcasting is enabled
if(!noBroadcast){ if(!noBroadcast){
//Broadcast changes //Broadcast changes
this.broadcastQueue(chanDB); this.broadcastQueue();
}
//If saving is disabled
if(!noScheduling){
//Save changes to the DB
await chanDB.save();
} }
} }
}catch(err){ }catch(err){
@ -1145,7 +1128,7 @@ class queue{
//If nowPlaying isn't null and isn't what we're about to throw on //If nowPlaying isn't null and isn't what we're about to throw on
if(chanDB.media.nowPlaying != null && chanDB.media.nowPlaying.uuid.toString() != mediaObj.uuid){ if(chanDB.media.nowPlaying != null && chanDB.media.nowPlaying.uuid.toString() != mediaObj.uuid){
//Archive whats already in there since we're about to clobber the fuck out of it //Archive whats already in there since we're about to clobber the fuck out of it
chanDB.media.archived.push(chanDB.media.nowPlaying); this.archiveMedia(chanDB.media.nowPlaying);
} }
//Set the now playing queued media document //Set the now playing queued media document
@ -1284,7 +1267,7 @@ class queue{
//If archiving is enabled //If archiving is enabled
if(!noArchive){ if(!noArchive){
//Add the item to the channel archive //Add the item to the channel archive
chanDB.media.archived.push(wasPlaying); await this.archiveMedia(wasPlaying);
} }
//broadcast queue using unsaved archive, run this before chanDB.save() for better responsiveness //broadcast queue using unsaved archive, run this before chanDB.save() for better responsiveness
@ -1383,7 +1366,7 @@ class queue{
let finished = false; let finished = false;
//Throw the livestream into the archive //Throw the livestream into the archive
chanDB.media.archived.push(wasPlaying); this.archiveMedia(wasPlaying);
//Save the DB //Save the DB
await chanDB.save(); await chanDB.save();
@ -1468,7 +1451,7 @@ class queue{
} }
//Throw the livestream into the archive //Throw the livestream into the archive
chanDB.media.archived.push(wasPlaying); this.archiveMedia(wasPlaying);
//Set the current place to schedule items at 5ms after the end of the live stream //Set the current place to schedule items at 5ms after the end of the live stream
let curPlace = wasPlaying.getEndTime() + 5; let curPlace = wasPlaying.getEndTime() + 5;
@ -1737,16 +1720,20 @@ class queue{
//Create an empty array to hold our schedule //Create an empty array to hold our schedule
let schedule = []; let schedule = [];
//Get yestedays epoch //Get todays epoch
const yesterday = new Date().setDate(new Date().getDate() - 1); const yesterday = new Date();
//Make it yesterdays
yesterday.setDate(yesterday.getDate() - 1);
//Get archive since yesterday
const archive = await this.getArchive(yesterday);
//Iterate through the channel archive backwards to save time //Iterate through the channel archive backwards to save time
for(let mediaIndex = chanDB.media.archived.length - 1; mediaIndex >= 0; mediaIndex--){ for(let mediaIndex = archive.length - 1; mediaIndex >= 0; mediaIndex--){
//Grab the current media record //Grab the current media record
let media = chanDB.media.archived[mediaIndex].rehydrate(); let media = archive[mediaIndex].rehydrate();
//If the media started within the last 24 hours
if(media.startTime > yesterday){
//If we're sending out the live remainder during a live stream //If we're sending out the live remainder during a live stream
if(this.liveRemainder != null && media.uuid.toString() == this.liveRemainder.uuid.toString()){ if(this.liveRemainder != null && media.uuid.toString() == this.liveRemainder.uuid.toString()){
//Throw out the early end before sending it off, so it looks like it hasn't been cut off yet (smoke n mirrors :P) //Throw out the early end before sending it off, so it looks like it hasn't been cut off yet (smoke n mirrors :P)
@ -1755,12 +1742,6 @@ class queue{
//Add it to the temporary schedule array as if it where part of the actual schedule map //Add it to the temporary schedule array as if it where part of the actual schedule map
schedule.unshift([media.startTime, media]); schedule.unshift([media.startTime, media]);
//Otherwise if it's older
}else{
//Then we should be done as archived items are added as they are played/end.
//No newer items should be beyond this point!
break;
}
} }
//Concatonate the actual schedule to the items we pulled out of the archive return it //Concatonate the actual schedule to the items we pulled out of the archive return it
@ -1810,7 +1791,7 @@ class queue{
chanDB.media.nowPlaying = null; chanDB.media.nowPlaying = null;
//Archive the bitch //Archive the bitch
chanDB.media.archived.push(wasPlaying); this.archiveMedia(wasPlaying);
} }
} }
@ -1840,36 +1821,36 @@ class queue{
//If it's been ended //If it's been ended
}else{ }else{
//Archive ended media //Archive ended media
chanDB.media.archived.push(record); this.archiveMedia(record);
} }
} }
} }
//If we have a remainder from a livestream //If we have a remainder from a livestream
if(chanDB.media.liveRemainder){ if(chanDB.media.liveRemainder){
//Iterate backwards through the archive to pull the newest first, since that's probably where this fucker is let archive = await this.getArchive();
for(let archiveIndex = (chanDB.media.archived.length - 1); archiveIndex > 0; archiveIndex--){
//Grab the current media object
const archivedMedia = chanDB.media.archived[archiveIndex];
//Iterate backwards through channel archive
for(let archiveIndex = (archive.length - 1); archiveIndex > 0; archiveIndex--){
//If the current object matches our remainder UUID //If the current object matches our remainder UUID
if((archivedMedia.uuid.toString() == chanDB.media.liveRemainder.toString())){ if((archive[archiveIndex].uuid.toString() == chanDB.media.liveRemainder.toString())){
//Null out any early end //Null out any early end
archivedMedia.earlyEnd = null; archive[archiveIndex].earlyEnd = null;
//Re-hydrate the item //Re-hydrate the item
const archivedMediaObject = archivedMedia.rehydrate(); const archivedMediaObject = archive[archiveIndex].rehydrate();
//if we still have a video to finish //if we still have a video to finish
if(archivedMediaObject.getEndTime() > now){ if(archivedMediaObject.getEndTime() > now){
//Set the fucker as now playing //Convert the fucker back to queuedMedia and save as now playing
chanDB.media.nowPlaying = archivedMediaObject; chanDB.media.nowPlaying = queuedMedia.fromArchivedMedia(archivedMediaObject);
//Schedule the fucker in RAM, w/ the start function also running in RAM-Only mode //Schedule the fucker in RAM, w/ the start function also running in RAM-Only mode
this.scheduleMedia([archivedMediaObject], null, chanDB, true, true, true); this.scheduleMedia([archivedMediaObject], null, chanDB, true, true, true);
//Splice the fucker out of the archive //Splice the fucker out of the archive
chanDB.media.archived.splice(archiveIndex, 1); await archivedMediaModel.deleteOne({channel: this.channel._id, uuid: new BSON.UUID(chanDB.media.liveRemainder)});
} }
//Break out of the loop //Break out of the loop
@ -1892,6 +1873,36 @@ class queue{
loggerUtils.localExceptionHandler(err); loggerUtils.localExceptionHandler(err);
} }
} }
/**
* Commits a queuedMedia object to the media archives
* @param {queuedMedia} media - Media object to be archived
*/
async archiveMedia(media){
//Convert queuedMedia object to archivedMedia object
let archived = archivedMedia.fromQueuedMedia(media, this.channel._id);
//Save archivedMedia object to site-wide media archive (gross but performant)
let archivedDoc = await archivedMediaModel.create(archived);
}
/**
* Get Channel Archive
*/
async getArchive(startDate){
//If we provided a start date
if(startDate != null){
//Return archived media after start date
return await archivedMediaModel.find({
channel:this.channel._id,
//Prevent mongoose from attempting to sanatize and invalidate our query object, plus I think we can trust an epoch that came from server-side :)
startTime: mongoose.trusted({$gt: startDate.getTime()})
});
//Otherwise
}else{
//return all archived media
return await archivedMediaModel.find({channel:this.channel._id});
}
}
} }
module.exports = queue; module.exports = queue;

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -21,7 +21,7 @@ const loggerUtils = require("../../../utils/loggerUtils");
const channelModel = require("../../../schemas/channel/channelSchema"); const channelModel = require("../../../schemas/channel/channelSchema");
/** /**
* Class containg global server-side private message relay logic * Class containg per-channel server-side queue broadcasting logic
* *
* Exists to make broadcasting channel queues to groups of authenticated users with the 'read-queue' perm as painless as possible, * Exists to make broadcasting channel queues to groups of authenticated users with the 'read-queue' perm as painless as possible,
* reducing DB call/perm checks to just connection time, and not requireing any out-of-library user iteration at broadcast time. * reducing DB call/perm checks to just connection time, and not requireing any out-of-library user iteration at broadcast time.

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -88,6 +88,27 @@ class queuedMedia extends media{
startTimeStamp); startTimeStamp);
} }
/**
* Creates a queuedMedia object from an archivedMedia object
* @param {String} channel - Channel where object was queued
* @returns {archivedMedia} queuedMedia object created from given media object
*/
static fromArchivedMedia(media){
//Create and return queuedMedia object from given media object and arguments
return new this(
media.title,
media.fileName,
media.url,
media.id,
media.type,
media.duration,
media.rawLink,
media.startTime,
media.startTimeStamp,
media.earlyEnd,
media.uuid);
}
/** /**
* Converts array of media objects into array of queuedMedia objects * Converts array of media objects into array of queuedMedia objects
* @param {Array} mediaList - Array of media objects to queue * @param {Array} mediaList - Array of media objects to queue

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,6 +1,6 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -30,7 +30,7 @@ const emoteModel = require('../emoteSchema');
const channelPermissionSchema = require('./channelPermissionSchema'); const channelPermissionSchema = require('./channelPermissionSchema');
const channelBanSchema = require('./channelBanSchema'); const channelBanSchema = require('./channelBanSchema');
const queuedMediaSchema = require('./media/queuedMediaSchema'); const queuedMediaSchema = require('./media/queuedMediaSchema');
const playlistSchema = require('./media/playlistSchema'); const {playlistSchema} = require('./media/playlist/playlistSchema');
const chatSchema = require('./chatSchema'); const chatSchema = require('./chatSchema');
//Utils //Utils
const { exceptionHandler, errorHandler } = require('../../utils/loggerUtils'); const { exceptionHandler, errorHandler } = require('../../utils/loggerUtils');
@ -666,77 +666,6 @@ channelSchema.methods.getEmotes = function(){
return emoteList; return emoteList;
} }
/**
* Generates Network-Friendly Browser-Digestable list of channel playlists
* @returns {Array} Network-Friendly Browser-Digestable list of channel playlists
*/
channelSchema.methods.getPlaylists = function(){
//Create an empty array to hold our emote list
const playlists = [];
//For each channel emote
for(let playlist of this.media.playlists){
//Push an object with select information from the emote to the emote list
playlists.push(playlist.dehydrate());
}
//return the emote list
return playlists;
}
/**
* Crawls through channel playlists, running a given callback function against each one
* @param {Function} cb - Callback function to run against channel playlists
*/
channelSchema.methods.playlistCrawl = function(cb){
for(let listIndex in this.media.playlists){
//Grab the associated playlist
playlist = this.media.playlists[listIndex];
//Call the callback with the playlist and list index as arguments
cb(playlist, listIndex);
}
}
/**
* Finds channel playlist by playlist name
* @param {String} name - name of given playlist to find
* @returns {Mongoose.Document} - Sub-Document representing a single playlist
*/
channelSchema.methods.getPlaylistByName = function(name){
//Create null value to hold our found playlist
let foundPlaylist = null;
//Crawl through active playlists
this.playlistCrawl((playlist, listIndex) => {
//If we found a match based on name
if(playlist.name == name){
//Keep it
foundPlaylist = playlist;
//Pass down the list index
foundPlaylist.listIndex = listIndex;
}
});
//return the given playlist
return foundPlaylist;
}
/**
* Deletes channel playlist by playlist name
* @param {String} name - name of given playlist to Delete
*/
channelSchema.methods.deletePlaylistByName = async function(name){
//Find the playlist
let playlist = this.getPlaylistByName(name);
//splice out the given playlist
this.media.playlists.splice(playlist.listIndex, 1);
//save the channel document
await this.save();
}
/** /**
* Generates Network-Friendly Browser-Digestable list of Channel-Wide user bans * Generates Network-Friendly Browser-Digestable list of Channel-Wide user bans
* @returns {Array} Network-Friendly Browser-Digestable list of Channel-Wide user bans * @returns {Array} Network-Friendly Browser-Digestable list of Channel-Wide user bans

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -0,0 +1,81 @@
/*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2026 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 <https://www.gnu.org/licenses/>.*/
//NPM Imports
const {mongoose} = require('mongoose');
//Local Imports
const mediaSchema = require('./mediaSchema');
const archivedMedia = require('../../../app/channel/media/archivedMedia');
/**
* DB Schema for documents representing a archived media object
*/
const archivedProperties = new mongoose.Schema({
channel: {
type: mongoose.SchemaTypes.ObjectID,
ref: "channel",
required: true
},
startTime: {
type: mongoose.SchemaTypes.Number,
required: true,
},
startTimeStamp: {
type: mongoose.SchemaTypes.Number,
required: false,
},
earlyEnd: {
type: mongoose.SchemaTypes.Number,
required: false,
},
uuid: {
type: mongoose.SchemaTypes.UUID,
required: true,
},
},
{
discriminatorKey: 'status'
});
//Methods
/**
* Rehydrate to a full phat archived media object
* @returns {archivedMedia} A full phat archived media object, re-hydrated from the DB
*/
archivedProperties.methods.rehydrate = function(){
return new archivedMedia(
this.title,
this.fileName,
this.url,
this.id,
this.type,
this.duration,
//We don't save raw links that are stored seperate from the standard URL as they tend to expire.
undefined,
this.startTime,
this.startTimeStamp,
this.earlyEnd,
this.uuid.toString(),
this.channel
);
}
//Create 'archivedMediaSchema' as descriminator of mediaSchema
var archivedMediaSchema = mediaSchema.discriminator('archived', archivedProperties);
//Export mongoose model based on archivedSchema
module.exports = mongoose.model("archivedMedia", archivedMediaSchema);

View file

@ -1,5 +1,5 @@
/*Canopy - The next generation of stoner streaming software /*Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

Some files were not shown because too many files have changed in this diff Show more