From 37990ff8c31862db834a7555f706302188013da8 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Sat, 25 Oct 2025 09:55:40 -0400 Subject: [PATCH] Traded bug with queue.end() being called as volatile from functions which handle their own DB save, in which stale item was left in cache, for a simple queue rending bug. --- src/app/channel/media/queue.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/channel/media/queue.js b/src/app/channel/media/queue.js index 8fa933f..ec44c81 100644 --- a/src/app/channel/media/queue.js +++ b/src/app/channel/media/queue.js @@ -1209,6 +1209,12 @@ class queue{ return this.endLivestream(wasPlaying, chanDB) } + + //Moved this from the block below to prevent accidental over-caching + //We may need to throw this into it's own conditional if it causes issues + //Take it out of the active schedule + this.schedule.delete(wasPlaying.startTime); + //If we're not in volatile mode and we're not ending a livestream if(!volatile){ //If we wheren't handed a channel @@ -1229,9 +1235,6 @@ class queue{ await chanDB.media.nowPlaying.deleteOne(); } - //Take it out of the active schedule - this.schedule.delete(wasPlaying.startTime); - //If archiving is enabled if(!noArchive){ //Add the item to the channel archive