浏览代码

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

Owen Diffey 3 年之前
父节点
当前提交
730b4d5a2c
共有 5 个文件被更改,包括 38 次插入26 次删除
  1. 5 9
      README.md
  2. 1 1
      backend/logic/app.js
  3. 15 9
      frontend/src/App.vue
  4. 3 1
      frontend/src/pages/Home.vue
  5. 14 6
      frontend/src/pages/Station/index.vue

+ 5 - 9
README.md

@@ -62,7 +62,7 @@ We currently only utilize 1 backend, 1 MongoDB server and 1 Redis server running
     | `skipDbDocumentsVersionCheck` | Skips checking if there are any DB documents outdated or not. Should almost always be set to false. |
     | `configVersion` | Version of the config. Every time the template changes, you should change your config accordingly and update the configVersion. |
 
-4. `cp frontend/build/config/template.json frontend/build/config/default.json`
+4. `cp frontend/dist/config/template.json frontend/dist/config/default.json`
 
     | Property | Description |
     | - | - |
@@ -210,19 +210,15 @@ ___
 
 ___
 
-1. Start the MongoDB database in the background.
+1. Start the MongoDB database & Redis in the background.
 
-    `docker-compose up -d mongo`
-
-2. Start redis and the mongo client in the background, as we usually don't need to monitor these for errors.
-
-    `docker-compose up -d mongoclient redis`
+    `docker-compose up -d mongo redis`
 
-3. Start the backend and frontend in the foreground, so we can watch for errors during development.
+2. Start the backend and frontend in the foreground, so we can watch for errors during development.
 
     `docker-compose up backend frontend`
 
-4. You should now be able to begin development!
+3. You should now be able to begin development!
 
     The backend is auto reloaded when you make changes and the frontend is auto compiled and live reloaded by webpack when you make changes.
     

+ 1 - 1
backend/logic/app.js

@@ -78,7 +78,7 @@ class _AppModule extends CoreClass {
 			 * @param {string} err - custom error message
 			 */
 			function redirectOnErr(res, err) {
-				res.redirect(`${config.get("domain")}/?err=${encodeURIComponent(err)}`);
+				res.redirect(`${config.get("domain")}?err=${encodeURIComponent(err)}`);
 			}
 
 			app.get("/auth/github/authorize", async (req, res) => {

+ 15 - 9
frontend/src/App.vue

@@ -135,7 +135,12 @@ export default {
 		});
 
 		if (localStorage.getItem("github_redirect")) {
-			this.$router.push(localStorage.getItem("github_redirect"));
+			setTimeout(
+				() =>
+					this.$router.push(localStorage.getItem("github_redirect")),
+				50
+			);
+
 			localStorage.removeItem("github_redirect");
 		}
 
@@ -157,7 +162,7 @@ export default {
 
 		this.apiDomain = await lofig.get("apiDomain");
 
-		this.$router.isReady(() => {
+		this.$router.isReady().then(() => {
 			if (this.$route.query.err) {
 				let { err } = this.$route.query;
 				err = err
@@ -166,6 +171,7 @@ export default {
 				this.$router.push({ query: {} });
 				new Toast({ content: err, timeout: 20000 });
 			}
+
 			if (this.$route.query.msg) {
 				let { msg } = this.$route.query;
 				msg = msg
@@ -265,14 +271,14 @@ export default {
 		color: var(--light-grey-2);
 	}
 
-	#toasts-container .toast {
-		// color: var(--dark-grey-2);
-		// background-color: var(--light-grey-3) !important;
+	// #toasts-container .toast {
+	// color: var(--dark-grey-2);
+	// background-color: var(--light-grey-3) !important;
 
-		// &:last-of-type {
-		// 	background-color: var(--light-grey) !important;
-		// }
-	}
+	// &:last-of-type {
+	// 	background-color: var(--light-grey) !important;
+	// }
+	// }
 
 	.input,
 	.textarea,

+ 3 - 1
frontend/src/pages/Home.vue

@@ -512,7 +512,9 @@ export default {
 				animation: 200,
 				group: "favoriteStations",
 				disabled: false,
-				ghostClass: "draggable-list-ghost"
+				ghostClass: "draggable-list-ghost",
+				filter: ".ignore-elements",
+				fallbackTolerance: 50
 			};
 		}
 	},

+ 14 - 6
frontend/src/pages/Station/index.vue

@@ -367,7 +367,7 @@
 										}}
 									</p>
 								</div>
-								<p id="volume-control" v-if="!isIOS">
+								<p id="volume-control" v-if="!isApple">
 									<i
 										v-if="muted"
 										class="material-icons"
@@ -821,7 +821,9 @@ export default {
 	data() {
 		return {
 			utils,
-			isIOS: navigator.platform.match(/iPhone|iPod|iPad/),
+			isApple:
+				navigator.platform.match(/iPhone|iPod|iPad/) ||
+				navigator.vendor === "Apple Computer, Inc.",
 			title: "Station",
 			loading: true,
 			exists: true,
@@ -996,6 +998,7 @@ export default {
 			if (!this.localPaused) this.resumeLocalPlayer();
 
 			if (this.currentSong) {
+				const currentSongId = this.currentSong._id;
 				if (this.nextSong)
 					this.setNextCurrentSong({
 						currentSong: this.nextSong,
@@ -1012,7 +1015,8 @@ export default {
 						pausedAt: 0
 					});
 				window.stationNextSongTimeout = setTimeout(() => {
-					this.skipSong("window.stationNextSongTimeout 2");
+					if (!this.noSong && this.currentSong._id === currentSongId)
+						this.skipSong("window.stationNextSongTimeout 2");
 				}, this.getTimeRemaining());
 			}
 		});
@@ -1354,7 +1358,11 @@ export default {
 							true
 						);
 					window.stationNextSongTimeout = setTimeout(() => {
-						this.skipSong("window.stationNextSongTimeout 1");
+						if (
+							!this.noSong &&
+							this.currentSong._id === currentSong._id
+						)
+							this.skipSong("window.stationNextSongTimeout 1");
 					}, this.getTimeRemaining());
 				}
 
@@ -1461,7 +1469,7 @@ export default {
 							this.playVideo();
 
 							// on ios, playback will be forcibly paused locally
-							if (this.isIOS) {
+							if (this.isApple) {
 								this.updateLocalPaused(true);
 								new Toast(
 									"Please click play manually to use Musare on iOS."
@@ -1630,7 +1638,7 @@ export default {
 				!this.stationPaused &&
 				!this.localPaused &&
 				this.playerReady &&
-				!this.isIOS
+				!this.isApple
 			) {
 				const timeElapsed = this.getTimeElapsed();
 				const currentPlayerTime =