From a1f08243308d453b898f77c22b9914e1a52d928c Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Tue, 28 Oct 2025 06:33:52 -0400 Subject: [PATCH] Fixed queue rendering issue by changing server-side behavior around queue broadcasting. --- src/app/channel/media/queue.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/channel/media/queue.js b/src/app/channel/media/queue.js index 671fac7..f52d75c 100644 --- a/src/app/channel/media/queue.js +++ b/src/app/channel/media/queue.js @@ -1078,6 +1078,7 @@ class queue{ if(this.nowPlaying != null){ //Silently end the media in RAM so the database isn't stepping on itself up ahead //Alternatively we could've used await, but then we'd be doubling up on DB transactions :P + //VOLATILE END this.end(true, true, true); } @@ -1116,6 +1117,9 @@ class queue{ //Save the channel await chanDB.save(); + + //Broadcast queue since we ended our media item early + this.broadcastQueue(chanDB); }catch(err){ loggerUtils.localExceptionHandler(err); } @@ -1171,7 +1175,7 @@ class queue{ * End currently playing media * @param {Boolean} quiet - Enable to prevent ending the media client-side * @param {Boolean} noArchive - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false - * @param {Boolean} volatile - Enable to prevent DB Transactions + * @param {Boolean} volatile - Enable to prevent DB Transactions, also prevents queue broadcasting so the calling code can broadcast once it's done. * @param {Mongoose.Document} chanDB - Pass through Channel Document to save on DB Transactions */ async end(quiet = false, noArchive = false, volatile = false, chanDB){ @@ -1247,9 +1251,6 @@ class queue{ //Save our changes to the DB await chanDB.save(); - }else{ - //broadcast queue using unsaved archive - this.broadcastQueue(chanDB); } }catch(err){ this.broadcastQueue();