Browse Source

Merge tag 'v3.5.0' into staging

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

+ 14 - 1
CHANGELOG.md

@@ -1,8 +1,21 @@
 # Changelog
 
+## [v3.5.0] - 2022-04-28
+
+This release includes all changes from v3.5.0-rc1 and v3.5.0-rc2, in addition to the following. Upgrade instructions can be found at [.wiki/Upgrading](.wiki/Upgrading.md).
+
+### Changed
+- refactor: close all modals upon route change
+
+### Fixed
+- fix: Autofilling station queue would reset requestedAt
+- fix: Station time elapsed would show false if 0
+
 ## [v3.5.0-rc2] - 2022-04-24
 
-## Added
+This release includes all changes from v3.5.0-rc1, in addition to the following.
+
+### Added
 - chore: Added docker-compose.override.yml documentation
 
 ### Fixed

+ 1 - 1
backend/logic/stations.js

@@ -558,7 +558,7 @@ class _StationsModule extends CoreClass {
 					(currentSongs, songsToAdd, currentSongIndex, next) => {
 						const newPlaylist = [...currentSongs, ...songsToAdd].map(song => {
 							if (!song._id) song._id = null;
-							song.requestedAt = Date.now();
+							if (!song.requestedAt) song.requestedAt = Date.now();
 							return song;
 						});
 						next(null, newPlaylist, currentSongIndex);

+ 2 - 2
backend/package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "musare-backend",
-  "version": "3.5.0-rc2",
+  "version": "3.5.0",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "musare-backend",
-      "version": "3.5.0-rc2",
+      "version": "3.5.0",
       "license": "GPL-3.0",
       "dependencies": {
         "async": "^3.2.3",

+ 1 - 1
backend/package.json

@@ -1,7 +1,7 @@
 {
   "name": "musare-backend",
   "private": true,
-  "version": "3.5.0-rc2",
+  "version": "3.5.0",
   "type": "module",
   "description": "An open-source collaborative music listening and catalogue curation application. Currently supporting YouTube based content.",
   "main": "index.js",

+ 2 - 2
frontend/js/utils.js

@@ -11,8 +11,8 @@ export default {
 			.join("");
 	},
 	formatTime: originalDuration => {
-		if (originalDuration) {
-			if (originalDuration < 0) return "0:00";
+		if (typeof originalDuration === "number") {
+			if (originalDuration <= 0) return "0:00";
 
 			let duration = originalDuration;
 			let hours = Math.floor(duration / (60 * 60));

+ 2 - 2
frontend/package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "musare-frontend",
-  "version": "3.5.0-rc2",
+  "version": "3.5.0",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "musare-frontend",
-      "version": "3.5.0-rc2",
+      "version": "3.5.0",
       "license": "GPL-3.0",
       "dependencies": {
         "@babel/runtime": "^7.17.9",

+ 1 - 1
frontend/package.json

@@ -5,7 +5,7 @@
     "*.vue"
   ],
   "private": true,
-  "version": "3.5.0-rc2",
+  "version": "3.5.0",
   "description": "An open-source collaborative music listening and catalogue curation application. Currently supporting YouTube based content.",
   "main": "main.js",
   "author": "Musare Team",

+ 5 - 3
frontend/src/main.js

@@ -221,9 +221,11 @@ router.beforeEach((to, from, next) => {
 		window.stationInterval = 0;
 	}
 
-	if (to.name === "station") {
-		store.dispatch("modalVisibility/closeModal", "manageStation");
-	}
+	// if (to.name === "station") {
+	// 	store.dispatch("modalVisibility/closeModal", "manageStation");
+	// }
+
+	store.dispatch("modalVisibility/closeAllModals");
 
 	if (ws.socket && to.fullPath !== from.fullPath) {
 		ws.clearCallbacks();

+ 11 - 0
frontend/src/store/modules/modalVisibility.js

@@ -76,6 +76,9 @@ const actions = {
 		}),
 	closeCurrentModal: ({ commit }) => {
 		commit("closeCurrentModal");
+	},
+	closeAllModals: ({ commit }) => {
+		commit("closeAllModals");
 	}
 };
 
@@ -109,6 +112,14 @@ const mutations = {
 		state.activeModals.pop();
 
 		delete state.modals[currentlyActiveModalUuid];
+	},
+	closeAllModals(state) {
+		state.activeModals.forEach(modalUuid => {
+			ws.destroyModalListeners(modalUuid);
+		});
+
+		state.activeModals = [];
+		state.modals = {};
 	}
 };