Fixed queue rendering issue by changing server-side behavior around queue broadcasting.
This commit is contained in:
parent
dd66601f0d
commit
a1f0824330
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue