浏览代码

Merge remote-tracking branch 'origin/polishing' into owen

Owen Diffey 3 年之前
父节点
当前提交
61dca7f067

+ 6 - 15
frontend/js/utils.js

@@ -43,11 +43,8 @@ export default {
 		const hours = Math.floor(duration / (60 * 60));
 		const formatHours = () => {
 			if (hours > 0) {
-				if (hours > 1) {
-					if (hours < 10) return `0${hours} hours `;
-					return `${hours} hours `;
-				}
-				return `0${hours} hour `;
+				if (hours > 1) return `${hours} hours `;
+				return `${hours} hour `;
 			}
 			return "";
 		};
@@ -55,11 +52,8 @@ export default {
 		const minutes = Math.floor((duration - hours * 60 * 60) / 60);
 		const formatMinutes = () => {
 			if (minutes > 0) {
-				if (minutes > 1) {
-					if (minutes < 10) return `0${minutes} minutes `;
-					return `${minutes} minutes `;
-				}
-				return `0${minutes} minute `;
+				if (minutes > 1) return `${minutes} minutes `;
+				return `${minutes} minute `;
 			}
 			return "";
 		};
@@ -67,11 +61,8 @@ export default {
 		const seconds = Math.floor(duration - hours * 60 * 60 - minutes * 60);
 		const formatSeconds = () => {
 			if (seconds > 0) {
-				if (seconds > 1) {
-					if (seconds < 10) return `0${seconds} seconds `;
-					return `${seconds} seconds `;
-				}
-				return `0${seconds} second `;
+				if (seconds > 1) return `${seconds} seconds `;
+				return `${seconds} second `;
 			}
 			return "";
 		};

+ 3 - 3
frontend/package-lock.json

@@ -8607,9 +8607,9 @@
       }
     },
     "url-parse": {
-      "version": "1.5.1",
-      "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz",
-      "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==",
+      "version": "1.5.3",
+      "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz",
+      "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==",
       "dev": true,
       "requires": {
         "querystringify": "^2.1.1",

+ 2 - 2
frontend/src/components/PlaylistItem.vue

@@ -23,8 +23,8 @@
 						:user-id="playlist.createdBy"
 						:link="true"
 					/>
-					•</span
-				>
+					•
+				</span>
 				<span :title="playlistLength">
 					{{ playlistLength }}
 				</span>

+ 2 - 2
frontend/src/components/modals/EditSong/index.vue

@@ -645,10 +645,10 @@ export default {
 	},
 	watch: {
 		/* eslint-disable */
-		"song.duration": function() {
+		"song.duration": function () {
 			this.drawCanvas();
 		},
-		"song.skipDuration": function() {
+		"song.skipDuration": function () {
 			this.drawCanvas();
 		}
 		/* eslint-enable */

+ 3 - 2
frontend/src/components/modals/ManageStation/index.vue

@@ -455,8 +455,8 @@ export default {
 			() => {}
 		);
 
+		if (this.isOwnerOrAdmin()) this.showTab("settings");
 		this.clearStation();
-		this.showTab("settings");
 	},
 	methods: {
 		isOwner() {
@@ -545,7 +545,8 @@ export default {
 		]),
 		...mapActions({
 			showTab(dispatch, payload) {
-				this.$refs[`${payload}-tab`].scrollIntoView();
+				if (this.$refs[`${payload}-tab`])
+					this.$refs[`${payload}-tab`].scrollIntoView(); // Only works if the ref exists, which it doesn't always
 				return dispatch("modals/manageStation/showTab", payload);
 			}
 		}),

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

@@ -1593,6 +1593,7 @@ export default {
 		calculateTimeElapsed() {
 			if (
 				this.playerReady &&
+				!this.noSong &&
 				this.currentSong &&
 				this.player.getPlayerState() === -1
 			) {