Browse Source

fix(Station page): likes/dislikes not included in songs in a station's queue

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 years ago
parent
commit
f0bd467021

+ 1 - 4
backend/logic/actions/stations.js

@@ -3290,10 +3290,7 @@ export default {
 						.catch(err => next(err));
 				},
 
-				(station, next) => {
-					if (station.type === "official") next(null, station.queue);
-					else next(null, station.queue);
-				}
+				(station, next) => next(null, station.queue)
 			],
 			async (err, queue) => {
 				if (err) {

+ 6 - 6
backend/logic/stations.js

@@ -554,15 +554,15 @@ class _StationsModule extends CoreClass {
 								"skipDuration",
 								"artists",
 								"thumbnail",
-								"status"
+								"status",
+								"likes",
+								"dislikes"
 							]
 						})
 							.then(response => {
-								const newSongsToAdd = songsToAdd.map(song => {
-									return response.songs.find(
-										newSong => newSong._id.toString() === song._id.toString()
-									);
-								});
+								const newSongsToAdd = songsToAdd.map(song =>
+									response.songs.find(newSong => newSong._id.toString() === song._id.toString())
+								);
 								next(null, currentSongs, newSongsToAdd, currentSongIndex);
 							})
 							.catch(err => next(err));

+ 2 - 0
frontend/src/pages/Station/index.vue

@@ -795,6 +795,7 @@ export default {
 				timePaused,
 				natural
 			} = res.data;
+
 			if (this.noSong || !natural) {
 				this.setCurrentSong({
 					currentSong,
@@ -1138,6 +1139,7 @@ export default {
 				nextSong = this.songsList[0].youtubeId
 					? this.songsList[0]
 					: null;
+
 			this.updateNextSong(nextSong);
 			this.setNextCurrentSong(
 				{