diff --git a/src/app/channel/media/queue.js b/src/app/channel/media/queue.js index 0e2627e..2ae14ec 100644 --- a/src/app/channel/media/queue.js +++ b/src/app/channel/media/queue.js @@ -298,6 +298,9 @@ module.exports = class{ //Get current item const currentItem = this.getItemAtEpoch() + //Clear out any stale timer to prevent ghost queueing + clearTimeout(this.nextTimer); + //If we have a current item and it isn't currently playing 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 @@ -310,8 +313,6 @@ module.exports = class{ //Calculate the amount of time in ms that the next item will start in const startsIn = nextItem.startTime - new Date().getTime(); - //Clear out any item that might be up next - clearTimeout(this.nextTimer); //Set the next timer this.nextTimer = setTimeout(()=>{this.start(nextItem, nextItem.startTimeStamp, volatile)}, startsIn); console.log(`next item '${nextItem.title}' timer set to start in ${startsIn} seconds`);