Browse Source

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

Owen Diffey 3 năm trước cách đây
mục cha
commit
730b4d5a2c

+ 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. |
     | `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. |
     | `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 |
     | 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`
     `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.
     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
 			 * @param {string} err - custom error message
 			 */
 			 */
 			function redirectOnErr(res, err) {
 			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) => {
 			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")) {
 		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");
 			localStorage.removeItem("github_redirect");
 		}
 		}
 
 
@@ -157,7 +162,7 @@ export default {
 
 
 		this.apiDomain = await lofig.get("apiDomain");
 		this.apiDomain = await lofig.get("apiDomain");
 
 
-		this.$router.isReady(() => {
+		this.$router.isReady().then(() => {
 			if (this.$route.query.err) {
 			if (this.$route.query.err) {
 				let { err } = this.$route.query;
 				let { err } = this.$route.query;
 				err = err
 				err = err
@@ -166,6 +171,7 @@ export default {
 				this.$router.push({ query: {} });
 				this.$router.push({ query: {} });
 				new Toast({ content: err, timeout: 20000 });
 				new Toast({ content: err, timeout: 20000 });
 			}
 			}
+
 			if (this.$route.query.msg) {
 			if (this.$route.query.msg) {
 				let { msg } = this.$route.query;
 				let { msg } = this.$route.query;
 				msg = msg
 				msg = msg
@@ -265,14 +271,14 @@ export default {
 		color: var(--light-grey-2);
 		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,
 	.input,
 	.textarea,
 	.textarea,

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

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