From 91c89ba28faf18242cf3dc8430b5acd0e7e073e3 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Mon, 21 Apr 2025 06:49:01 -0400 Subject: [PATCH] Added verbosity and fixed bug in refreshNextTimer --- src/app/channel/media/queue.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/channel/media/queue.js b/src/app/channel/media/queue.js index 7e342dd..0e2627e 100644 --- a/src/app/channel/media/queue.js +++ b/src/app/channel/media/queue.js @@ -302,10 +302,11 @@ module.exports = class{ if(currentItem != null && (this.nowPlaying == null || currentItem.uuid != this.nowPlaying.uuid)){ //Start the found item at w/ a pre-calculated time stamp to reflect the given start time this.start(currentItem, Math.round((new Date().getTime() - currentItem.startTime) / 1000) + currentItem.startTimeStamp, volatile); - } - - //If we have a next item - if(nextItem != null){ + console.log("starting now from refreshNextTimer") + //Otherwise, if we have a next item + //CODE CHANGE CODE CHANGE + //Changes this over to an else if so refreshNextTimer wouldn't start it twice when there was no current item or next item + }else if(nextItem != null){ //Calculate the amount of time in ms that the next item will start in const startsIn = nextItem.startTime - new Date().getTime(); @@ -721,6 +722,7 @@ module.exports = class{ //Kick off the sync timer this.syncTimer = setTimeout(this.sync.bind(this), this.syncDelta); + console.log('kicking off sync timer from start'); //Setup the next video this.refreshNextTimer(); @@ -746,6 +748,7 @@ module.exports = class{ //Call the sync function in another second this.syncTimer = setTimeout(this.sync.bind(this), this.syncDelta); + console.log('re-kicking sync timer from sync'); }else{ //Get leftover video length in ms const leftover = (this.nowPlaying.duration - this.timestamp) * 1000;