Added JSDoc for Class Members of src/app/channel/*

This commit is contained in:
rainbow napkin 2025-09-06 00:32:37 -04:00
parent 1aa836ba48
commit f34ad4829c
110 changed files with 6072 additions and 317 deletions

View file

@ -29,12 +29,39 @@ class media{
* @param {String} rawLink - URL to raw file copy of media, not applicable to all sources
*/
constructor(title, fileName, url, id, type, duration, rawLink = url){
/**
* Chosen title of media
*/
this.title = title;
/**
* Original filename/title of media provided by source
*/
this.fileName = fileName
/**
* Original URL to file
*/
this.url = url;
/**
* Video ID from source (IE: youtube watch code/archive.org file path)
*/
this.id = id;
/**
* Original video source
*/
this.type = type;
/**
* Length of media in seconds
*/
this.duration = duration;
/**
* URL to raw file copy of media, not applicable to all sources
*/
this.rawLink = rawLink;
}
}

View file

@ -34,9 +34,14 @@ class playlistHandler{
* @param {activeChannel} channel - Parent Channel object for desired channel queue
*/
constructor(server, channel){
//Set server
/**
* Parent Server Object
*/
this.server = server
//Set channel
/**
* Parent Channel Object for desired channel queue
*/
this.channel = channel;
}

View file

@ -34,38 +34,67 @@ class queue{
* @param {activeChannel} channel - Parent Channel object for desired channel queue
*/
constructor(server, chanDB, channel){
//Set server
/**
* Parent Server Object
*/
this.server = server
//Set channel
/**
* Parent Chennel Object for desired channel queue
*/
this.channel = channel;
//Create map to hold currently queued media
/**
* Map containing current schedule
*/
this.schedule = new Map();
//Create variable to hold sync delta in ms
/**
* Sync Delta in MS
*/
this.syncDelta = 1000;
//Create variable to hold current timestamp within the video
/**
* Current Timestamp in Media
*/
this.timestamp = 0;
//Delay between pre-switch function call and start of media
//This should be enough time to do things like pre-fetch updated raw links from youtube
/**
* Time before media switch to run pre-switch method call against next media
*/
this.preSwitchDelta = 10 * 1000;
//Create variable to hold sync timer
/**
* Syncronization Timer
*/
this.syncTimer = null;
//Create variable to hold next playing item timer
/**
* Next Media Timer
*/
this.nextTimer = null;
//Create vairable to hold pre-switch timer
/**
* Next Media Pre-Switch Timer
*/
this.preSwitchTimer = null;
//Create variable to hold currently playing media object
/**
* Currently Playing Media Item
*/
this.nowPlaying = null;
//Create variable to hold item that was playing during the last liveStream (can't check against full duration since it might've been stopped for other reasons)
/**
* Media interrupted by current live-stream
*/
this.liveRemainder = null;
//Create variable to hold current live mode
/**
* Current live-stream schedule mode
*/
this.liveMode = null;
//Create variable to lock standard queuing functions during livestreams
/**
* Locks scheduling functionality during livestreams
*/
this.streamLock = false;
//create boolean to hold schedule lock
/**
* Locks schedule upon admin request
*/
this.locked = false;
//Rehydrate channel queue from database

View file

@ -32,13 +32,25 @@ class queuedMedia extends media{
constructor(title, fileName, url, id, type, duration, rawLink, startTime, startTimeStamp = 0, earlyEnd, uuid){
//Call derived constructor
super(title, fileName, url, id, type, duration, rawLink);
//Set media start time
/**
* JS Epoch (millis) representing start time
*/
this.startTime = startTime;
//Set the media start time stamp
/**
* Media start time stamp in seconds (relative to duration)
*/
this.startTimeStamp = startTimeStamp;
//Create empty variable to hold early end if media is stopped early
/**
* Media ent timestamp in seconds (relative to duration)
*/
this.earlyEnd = earlyEnd;
//Set status for discriminator key
/**
* Media status type
*/
this.status = 'queued';
//If we have a null uuid (can't use default argument because of 'this')
@ -47,6 +59,9 @@ class queuedMedia extends media{
//That way even if we have six copies of the same video queued, we can still uniquely idenitify each instance
this.genUUID();
}else{
/**
* Media object's unique identifier
*/
this.uuid = uuid;
}
}