瀏覽代碼

Fixed issue with station playlists.

KrisVos130 8 年之前
父節點
當前提交
bbfdb3d255
共有 2 個文件被更改,包括 4 次插入3 次删除
  1. 2 2
      backend/logic/stations.js
  2. 2 1
      frontend/components/Modals/EditSong.vue

+ 2 - 2
backend/logic/stations.js

@@ -133,13 +133,13 @@ module.exports = {
 					db.models.song.find({genres: genre}, (err, songs) => {
 						if (!err) {
 							songs.forEach((song) => {
-								if (songList.indexOf(song.songId) === -1) {
+								if (songList.indexOf(song._id) === -1) {
 									let found = false;
 									song.genres.forEach((songGenre) => {
 										if (station.blacklistedGenres.indexOf(songGenre) !== -1) found = true;
 									});
 									if (!found) {
-										songList.push(song.songId);
+										songList.push(song._id);
 									}
 								}
 							});

+ 2 - 1
frontend/components/Modals/EditSong.vue

@@ -248,8 +248,9 @@
 			getSpotifySongs: function() {
 				this.socket.emit('apis.getSpotifySongs', this.spotify.title, this.spotify.artist, (res) => {
 					if (res.status === 'success') {
+						Toast.methods.addToast(`Succesfully got ${res.songs.length} song${(res.songs.length !== 1) ? 's' : ''}.`, 3000);
 						this.spotify.songs = res.songs;
-					}
+					} else Toast.methods.addToast(`Failed to get songs. ${res.message}`, 3000);
 				});
 			}
 		},