Added verbosity and fixed bug in refreshNextTimer

This commit is contained in:
rainbow napkin 2025-04-21 06:49:01 -04:00
parent e1528c0155
commit 91c89ba28f

View file

@ -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;