diff --git a/src/app/channel/media/queue.js b/src/app/channel/media/queue.js index 8c8ae1d..7f677c5 100644 --- a/src/app/channel/media/queue.js +++ b/src/app/channel/media/queue.js @@ -283,6 +283,10 @@ module.exports = class{ //Get current item const currentItem = this.getItemAtEpoch() + + //Clear out any stale timers 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 @@ -292,8 +296,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); }