Browse Source

If song is defaultSong, reports are not available

theflametrooper 8 years ago
parent
commit
332a01a63a

+ 3 - 4
backend/logic/stations.js

@@ -389,11 +389,10 @@ module.exports = {
 
 	defaultSong: {
 		_id: '60ItHLz5WEA',
-		title: 'Faded',
-		artists: ['Alan Walker'],
+		title: 'Faded - Alan Walker',
 		duration: 212,
-		skipDuration: 0,
-		thumbnail: 'https://i.scdn.co/image/2ddde58427f632037093857ebb71a67ddbdec34b'
+		likes: -1,
+		dislikes: -1
 	}
 
 };

+ 6 - 9
frontend/components/Admin/Reports.vue

@@ -51,15 +51,12 @@
 		methods: {},
 		ready: function () {
 			let _this = this;
-			let socketInterval = setInterval(() => {
-				if (!!_this.$parent.$parent.socket) {
-					_this.socket = _this.$parent.$parent.socket;
-					_this.socket.emit('reports.index', res => {
-						_this.reports = res.data;
-					});
-					clearInterval(socketInterval);
-				}
-			}, 100);
+			io.getSocket((socket) => {
+				_this.socket = socket;
+				_this.socket.emit('reports.index', res => {
+					_this.reports = res.data;
+				});
+			});
 		}
 	}
 </script>

+ 2 - 2
frontend/components/Station/OfficialHeader.vue

@@ -14,7 +14,7 @@
 					<i class='material-icons'>queue_music</i>
 				</span>
 			</a>
-			<a v-if='$parent.$parent.loggedIn && !$parent.noSong' class='nav-item' href='#' @click='$parent.modals.report = !$parent.modals.report'>
+			<a v-if='$parent.$parent.loggedIn && !$parent.noSong && !$parent.simpleSong' class='nav-item' href='#' @click='$parent.modals.report = !$parent.modals.report'>
 				<span class='icon'>
 					<i class='material-icons'>report</i>
 				</span>
@@ -43,7 +43,7 @@
 		</div>
 
 		<div class='nav-center stationDisplayName'>
-			{{$parent.station.displayName}}
+			{{ $parent.station.displayName }}
 		</div>
 
 		<span class="nav-toggle" :class="{ 'is-active': isMobile }" @click="isMobile = !isMobile">

+ 1 - 3
frontend/components/Station/Station.vue

@@ -355,9 +355,7 @@
 					if (data.currentSong) {
 						_this.noSong = false;
 						_this.simpleSong = (data.currentSong.likes === -1 && data.currentSong.dislikes === -1);
-						if (_this.simpleSong) {
-							_this.currentSong.skipDuration = 0;
-						}
+						if (_this.simpleSong) _this.currentSong.skipDuration = 0;
 						if (!_this.playerReady) _this.youtubeReady();
 						else _this.playVideo();
 						_this.socket.emit('songs.getOwnSongRatings', data.currentSong._id, (data) => {