瀏覽代碼

style: eslint issues from the resolved merge conflicts

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 4 年之前
父節點
當前提交
6302bf40a8
共有 2 個文件被更改,包括 109 次插入107 次删除
  1. 71 73
      frontend/src/components/modals/EditStation.vue
  2. 38 34
      frontend/src/pages/Station/index.vue

+ 71 - 73
frontend/src/components/modals/EditStation.vue

@@ -512,79 +512,77 @@ export default {
 		})
 	},
 	mounted() {
-    this.socket.dispatch(`stations.getStationById`, this.stationId, res => {
-      if (res.status === "success") {
-        const { station } = res;
-        // this.song = { ...song };
-        // if (this.song.discogs === undefined)
-        // 	this.song.discogs = null;
-        this.editStation(station);
-
-        // this.songDataLoaded = true;
-
-        this.socket.dispatch(
-          `stations.getStationIncludedPlaylistsById`,
-          this.stationId,
-          res => {
-            if (res.status === "success") {
-              this.station.genres = res.playlists.map(
-                playlist => {
-                  if (playlist) {
-                    if (playlist.type === "genre")
-                      return playlist.createdFor;
-                    return `Playlist: ${playlist.name}`;
-                  }
-                  return "Unknown/Error";
-                }
-              );
-              this.originalStation.genres = JSON.parse(
-                JSON.stringify(this.station.genres)
-              );
-            }
-          }
-        );
-
-        this.socket.dispatch(
-          `stations.getStationExcludedPlaylistsById`,
-          this.stationId,
-          res => {
-            if (res.status === "success") {
-              this.station.blacklistedGenres = res.playlists.map(
-                playlist => {
-                  if (playlist) {
-                    if (playlist.type === "genre")
-                      return playlist.createdFor;
-                    return `Playlist: ${playlist.name}`;
-                  }
-                  return "Unknown/Error";
-                }
-              );
-              this.originalStation.blacklistedGenres = JSON.parse(
-                JSON.stringify(
-                  this.station.blacklistedGenres
-                )
-              );
-            }
-          }
-        );
-
-        // this.station.genres = JSON.parse(
-        // 	JSON.stringify(this.station.genres)
-        // );
-        // this.station.blacklistedGenres = JSON.parse(
-        // 	JSON.stringify(this.station.blacklistedGenres)
-        // );
-      } else {
-        new Toast({
-          content: "Station with that ID not found",
-          timeout: 3000
-        });
-        this.closeModal({
-          sector: this.sector,
-          modal: "editStation"
-        });
-      }
-    });
+		this.socket.dispatch(`stations.getStationById`, this.stationId, res => {
+			if (res.status === "success") {
+				const { station } = res;
+				// this.song = { ...song };
+				// if (this.song.discogs === undefined)
+				// 	this.song.discogs = null;
+				this.editStation(station);
+
+				// this.songDataLoaded = true;
+
+				this.socket.dispatch(
+					`stations.getStationIncludedPlaylistsById`,
+					this.stationId,
+					res => {
+						if (res.status === "success") {
+							this.station.genres = res.playlists.map(
+								playlist => {
+									if (playlist) {
+										if (playlist.type === "genre")
+											return playlist.createdFor;
+										return `Playlist: ${playlist.name}`;
+									}
+									return "Unknown/Error";
+								}
+							);
+							this.originalStation.genres = JSON.parse(
+								JSON.stringify(this.station.genres)
+							);
+						}
+					}
+				);
+
+				this.socket.dispatch(
+					`stations.getStationExcludedPlaylistsById`,
+					this.stationId,
+					res => {
+						if (res.status === "success") {
+							this.station.blacklistedGenres = res.playlists.map(
+								playlist => {
+									if (playlist) {
+										if (playlist.type === "genre")
+											return playlist.createdFor;
+										return `Playlist: ${playlist.name}`;
+									}
+									return "Unknown/Error";
+								}
+							);
+							this.originalStation.blacklistedGenres = JSON.parse(
+								JSON.stringify(this.station.blacklistedGenres)
+							);
+						}
+					}
+				);
+
+				// this.station.genres = JSON.parse(
+				// 	JSON.stringify(this.station.genres)
+				// );
+				// this.station.blacklistedGenres = JSON.parse(
+				// 	JSON.stringify(this.station.blacklistedGenres)
+				// );
+			} else {
+				new Toast({
+					content: "Station with that ID not found",
+					timeout: 3000
+				});
+				this.closeModal({
+					sector: this.sector,
+					modal: "editStation"
+				});
+			}
+		});
 	},
 	methods: {
 		saveChanges() {

+ 38 - 34
frontend/src/pages/Station/index.vue

@@ -681,29 +681,29 @@ export default {
 
 			this.songsList.forEach(queueSong => {
 				if (queueSong.requestedBy === this.userId) isInQueue = true;
-    	});
-      
-      if (
-        !isInQueue &&
-        this.privatePlaylistQueueSelected &&
-        (this.automaticallyRequestedSongId !==
-          this.currentSong.songId ||
-          !this.currentSong.songId)
-      ) {
-        this.addFirstPrivatePlaylistSongToQueue();
-      }
-
-      if (this.station.type === "official") {
-        this.socket.dispatch(
-          "stations.getQueue",
-          this.station._id,
-          res => {
-            if (res.status === "success") {
-              this.updateSongsList(res.queue);
-            }
-          }
-        );
-      }
+			});
+
+			if (
+				!isInQueue &&
+				this.privatePlaylistQueueSelected &&
+				(this.automaticallyRequestedSongId !==
+					this.currentSong.songId ||
+					!this.currentSong.songId)
+			) {
+				this.addFirstPrivatePlaylistSongToQueue();
+			}
+
+			if (this.station.type === "official") {
+				this.socket.dispatch(
+					"stations.getQueue",
+					this.station._id,
+					res => {
+						if (res.status === "success") {
+							this.updateSongsList(res.queue);
+						}
+					}
+				);
+			}
 
 			if (
 				!isInQueue &&
@@ -1563,17 +1563,21 @@ export default {
 								}
 							);
 						}
-            
-            if (
-              (type === "community" && partyMode === true) ||
-              type === "official"
-            ) {
-              this.socket.dispatch("stations.getQueue", _id, res => {
-                if (res.status === "success") {
-                  this.updateSongsList(res.queue);
-                }
-              });
-            }
+
+						if (
+							(type === "community" && partyMode === true) ||
+							type === "official"
+						) {
+							this.socket.dispatch(
+								"stations.getQueue",
+								_id,
+								res => {
+									if (res.status === "success") {
+										this.updateSongsList(res.queue);
+									}
+								}
+							);
+						}
 
 						if (this.isOwnerOrAdmin()) {
 							keyboardShortcuts.registerShortcut(