Browse Source

Fixed issue where songs vote-skipped would not remove song-skip timer

Kristian Vos 4 years ago
parent
commit
4e3bfd5355
2 changed files with 10 additions and 3 deletions
  1. 0 3
      backend/logic/actions/stations.js
  2. 10 0
      backend/logic/stations.js

+ 0 - 3
backend/logic/actions/stations.js

@@ -849,9 +849,6 @@ export default {
 					);
 					return cb({ status: "failure", message: err });
 				}
-				NotificationsModule.runJob("UNSCHEDULE", {
-					name: `stations.nextSong?id=${stationId}`
-				});
 				StationsModule.runJob("SKIP_STATION", { stationId });
 				console.log("SUCCESS", "STATIONS_FORCE_SKIP", `Force skipped station "${stationId}" successfully.`);
 				return cb({

+ 10 - 0
backend/logic/stations.js

@@ -654,6 +654,16 @@ class _StationsModule extends CoreClass {
 
 			async.waterfall(
 				[
+					next => {
+						NotificationsModule.runJob("UNSCHEDULE", {
+							name: `stations.nextSong?id=${payload.stationId}`
+						})
+							.then(() => {
+								next();
+							})
+							.catch(next);
+					},
+
 					next => {
 						StationsModule.runJob(
 							"GET_STATION",