Selaa lähdekoodia

fix: if skipping community+party+paused, don't use next song in queue

Kristian Vos 5 vuotta sitten
vanhempi
commit
7ead7145a2
1 muutettua tiedostoa jossa 8 lisäystä ja 4 poistoa
  1. 8 4
      backend/logic/stations.js

+ 8 - 4
backend/logic/stations.js

@@ -344,10 +344,14 @@ module.exports = class extends coreClass {
 					if (!station) return next('Station not found.');
 					if (station.type === 'community' && station.partyMode && station.queue.length === 0) return next(null, null, -11, station); // Community station with party mode enabled and no songs in the queue
 					if (station.type === 'community' && station.partyMode && station.queue.length > 0) { // Community station with party mode enabled and songs in the queue
-						return this.db.models.station.updateOne({_id: stationId}, {$pull: {queue: {_id: station.queue[0]._id}}}, (err) => {
-							if (err) return next(err);
-							next(null, station.queue[0], -12, station);
-						});
+						if (station.paused) {
+							return next(null, null, -19, station);
+						} else {
+							return this.db.models.station.updateOne({_id: stationId}, {$pull: {queue: {_id: station.queue[0]._id}}}, (err) => {
+								if (err) return next(err);
+								next(null, station.queue[0], -12, station);
+							});
+						}
 					}
 					if (station.type === 'community' && !station.partyMode) {
 						return this.db.models.playlist.findOne({_id: station.privatePlaylist}, (err, playlist) => {