Browse Source

Allowed all songs to be reported,edited and liked/disliked

Owen Diffey 4 years ago
parent
commit
14144e969c

+ 3 - 12
backend/logic/stations.js

@@ -618,7 +618,8 @@ class _StationsModule extends CoreClass {
 											thumbnail: song.thumbnail,
 											requestedAt: song.requestedAt,
 											likes: song.likes,
-											dislikes: song.dislikes
+											dislikes: song.dislikes,
+											verified: song.verified
 										};
 
 										return next(null, newSong);
@@ -887,17 +888,7 @@ class _StationsModule extends CoreClass {
 						const $set = {};
 
 						if (song === null) $set.currentSong = null;
-						else if (song.likes === -1 && song.dislikes === -1) {
-							$set.currentSong = {
-								songId: song.songId,
-								title: song.title,
-								duration: song.duration,
-								skipDuration: 0,
-								likes: -1,
-								dislikes: -1,
-								requestedAt: song.requestedAt
-							};
-						} else {
+						else {
 							$set.currentSong = {
 								_id: song._id,
 								songId: song.songId,

+ 2 - 8
frontend/src/components/modals/EditPlaylist/index.vue

@@ -282,10 +282,7 @@
 											>
 
 											<i
-												v-if="
-													!song.simpleSong &&
-														userRole === 'admin'
-												"
+												v-if="userRole === 'admin'"
 												class="material-icons report-icon"
 												@click="
 													reportSongInPlaylist(song)
@@ -295,10 +292,7 @@
 											</i>
 
 											<i
-												v-if="
-													!song.simpleSong &&
-														userRole === 'admin'
-												"
+												v-if="userRole === 'admin'"
 												class="material-icons edit-icon"
 												@click="
 													editSongInPlaylist(song)

+ 2 - 2
frontend/src/pages/Station/components/CurrentlyPlaying.vue

@@ -56,7 +56,7 @@
 				<button
 					class="button"
 					id="report-icon"
-					v-if="loggedIn && !song.simpleSong"
+					v-if="loggedIn"
 					@click="report(song)"
 				>
 					<i class="material-icons icon-with-button">flag</i>
@@ -72,7 +72,7 @@
 				<button
 					class="button is-primary"
 					id="editsong-icon"
-					v-if="$parent.isAdminOnly() && !song.simpleSong"
+					v-if="$parent.isAdminOnly()"
 					@click="$parent.editSong(song)"
 				>
 					<i class="material-icons icon-with-button">edit</i>

+ 2 - 10
frontend/src/pages/Station/components/Sidebar/Queue/QueueItem.vue

@@ -57,11 +57,7 @@
 			</p>
 			<div class="universal-item-actions">
 				<i
-					v-if="
-						$parent.loggedIn &&
-							song.likes !== -1 &&
-							song.dislikes !== -1
-					"
+					v-if="$parent.loggedIn"
 					class="material-icons report-icon"
 					@click="report(song)"
 				>
@@ -73,11 +69,7 @@
 					>queue</i
 				>
 				<i
-					v-if="
-						$parent.isAdminOnly() &&
-							song.likes !== -1 &&
-							song.dislikes !== -1
-					"
+					v-if="$parent.isAdminOnly()"
 					class="material-icons edit-icon"
 					@click="$parent.$parent.$parent.editSong(song)"
 				>

+ 1 - 11
frontend/src/pages/Station/index.vue

@@ -172,10 +172,6 @@
 									<!-- Ratings (Like/Dislike) Buttons -->
 									<div
 										id="ratings"
-										v-if="
-											currentSong.likes !== -1 &&
-												currentSong.dislikes !== -1
-										"
 										:class="{
 											liked: liked,
 											disliked: disliked
@@ -253,13 +249,7 @@
 								</div>
 								<div id="right-buttons" v-else>
 									<!-- Disabled Ratings (Like/Dislike) Buttons -->
-									<div
-										id="ratings"
-										v-if="
-											currentSong.likes !== -1 &&
-												currentSong.dislikes !== -1
-										"
-									>
+									<div id="ratings">
 										<!-- Disabled Like Song Button -->
 										<button
 											class="button is-success tooltip tooltip-top disabled"

+ 0 - 7
frontend/src/store/modules/station.js

@@ -76,13 +76,6 @@ const mutations = {
 		state.users = users;
 	},
 	updateCurrentSong(state, currentSong) {
-		if (currentSong.likes === -1 && currentSong.dislikes === -1) {
-			currentSong.skipDuration = 0;
-			currentSong.simpleSong = true;
-		} else {
-			currentSong.simpleSong = false;
-		}
-
 		state.currentSong = currentSong;
 	},
 	updatePreviousSong(state, previousSong) {