Browse Source

Fixed genres not displaying in EditStation modal on station pages

Owen Diffey 4 years ago
parent
commit
d2ee8d9904

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

@@ -589,7 +589,9 @@ export default {
 						locked: station.locked,
 						partyMode: station.partyMode,
 						owner: station.owner,
-						privatePlaylist: station.privatePlaylist
+						privatePlaylist: station.privatePlaylist,
+						genres: station.genres,
+						blacklistedGenres: station.blacklistedGenres
 					};
 					userList[session.socketId] = station._id;
 					next(null, data);

+ 12 - 3
frontend/src/components/modals/EditStation.vue

@@ -38,7 +38,10 @@
 							</p>
 						</div>
 					</div>
-					<div class="col col-2" v-if="editing.genres">
+					<div
+						class="col col-2"
+						v-if="editing.type === 'official' && editing.genres"
+					>
 						<div>
 							<label class="label">Genre(s)</label>
 							<p class="control has-addons">
@@ -159,8 +162,14 @@
 					</div>
 
 					<!--  Choose a playlist -->
-					<div v-if="!editing.partyMode && playlists.length > 0">
-						<hr style="margin: 10px 0 20px 0;" />
+					<div
+						v-if="
+							editing.type === 'community' &&
+								!editing.partyMode &&
+								playlists.length > 0
+						"
+					>
+						<hr style="margin: 10px 0 20px 0" />
 
 						<h4 class="section-title">Choose a playlist</h4>
 						<p class="section-description">

+ 9 - 3
frontend/src/pages/Station/index.vue

@@ -669,7 +669,9 @@ export default {
 				description: this.station.description,
 				privacy: this.station.privacy,
 				displayName: this.station.displayName,
-				locked: this.station.locked
+				locked: this.station.locked,
+				genres: this.station.genres,
+				blacklistedGenres: this.station.blacklistedGenres
 			});
 			this.openModal({
 				sector: "station",
@@ -1199,7 +1201,9 @@ export default {
 						partyMode,
 						owner,
 						privatePlaylist,
-						type
+						type,
+						genres,
+						blacklistedGenres
 					} = res.data;
 
 					this.joinStation({
@@ -1212,7 +1216,9 @@ export default {
 						partyMode,
 						owner,
 						privatePlaylist,
-						type
+						type,
+						genres,
+						blacklistedGenres
 					});
 
 					const currentSong = res.data.currentSong