Updated streamType enum to change hls to livehls

This commit is contained in:
rainbow napkin 2026-07-09 23:15:47 -04:00
parent d49a644c47
commit 8f02be793f
5 changed files with 25 additions and 20 deletions

View file

@ -329,7 +329,10 @@ class queue{
*/
async goLive(socket, data){
try{
//Define and/or declare required variables
let title = "Livestream";
let filename;
let streamURL;
if(data != null && data.title != null){
//If the title is too long
@ -383,24 +386,26 @@ class queue{
//Kill schedule timers to prevent items from starting during the stream
await this.stopScheduleTimers();
//Syntatic sugar because I'm lazy :P
const streamURL = chanDB.settings.streamURL;
if(chanDB.settings.streamType == "livehls"){
//Syntatic sugar because I'm lazy :P
streamURL = chanDB.settings.streamURL;
if(streamURL == ''){
throw loggerUtils.exceptionSmith('This channel\'s HLS Livestream Source has not been set!', 'queue');
}
if(streamURL == ''){
throw loggerUtils.exceptionSmith('This channel\'s HLS Livestream Source has not been set!', 'queue');
}
//Pull filename from streamURL
let filename = streamURL.match(/^.+\..+\/(.+)$/);
//Pull filename from streamURL
filename = streamURL.match(/^.+\..+\/(.+)$/);
//If we're streaming from the root of the domain
if(filename == null){
//Set filename to root
filename = '/';
}else{
//Otherwise, hand over the filename
filename = filename[1];
//If we're streaming from the root of the domain
if(filename == null){
//Set filename to root
filename = '/';
}else{
//Otherwise, hand over the filename
filename = filename[1];
}
}
//Create queued media object from stream URL and set it to nowPlaying
@ -409,7 +414,7 @@ class queue{
filename,
streamURL,
streamURL,
"livehls",
chanDB.settings.streamType,
0,
streamURL,
new Date().getTime()