2
0
Owen Diffey 2 жил өмнө
parent
commit
a386b273eb

+ 0 - 47
.github/dependabot.yml

@@ -1,47 +0,0 @@
-version: 2
-updates:
-
-  # Maintain dependencies for GitHub Actions
-  - package-ecosystem: "github-actions"
-    directory: "/"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"
-
-  # Maintain dependencies for backend npm
-  - package-ecosystem: "npm"
-    directory: "/backend"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"
-
-  # Maintain dependencies for backend docker
-  - package-ecosystem: "docker"
-    directory: "/backend"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"
-
-  # Maintain dependencies for frontend npm
-  - package-ecosystem: "npm"
-    directory: "/frontend"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"
-
-  # Maintain dependencies for frontend docker
-  - package-ecosystem: "docker"
-    directory: "/frontend"
-    target-branch: "staging"
-    schedule:
-      interval: "weekly"
-      day: "friday"
-      time: "12:00"

+ 18 - 0
CHANGELOG.md

@@ -1,5 +1,23 @@
 # Changelog
 
+## [v3.7.1] - 2022-09-02
+
+Upgrade instructions can be found at [.wiki/Upgrading](.wiki/Upgrading.md).
+
+### Added
+
+- feat: Added update events to view punishment modal
+
+### Fixed
+
+- fix: Unable to resume station with no current song
+- fix: Unable to create new songs with editSong modal
+- fix: Unable to change casing of username
+
+### Removed
+
+- chore: Removed dependabot action
+
 ## [v3.7.0] - 2022-08-27
 
 This release contains mostly internal refactors, and includes all

+ 1 - 0
backend/logic/actions/apis.js

@@ -134,6 +134,7 @@ export default {
 			room.startsWith("edit-user.") ||
 			room.startsWith("view-api-request.") ||
 			room.startsWith("view-youtube-video.") ||
+			room.startsWith("view-punishment.") ||
 			room === "import-album" ||
 			room === "edit-songs"
 		) {

+ 1 - 1
backend/logic/actions/users.js

@@ -2001,7 +2001,7 @@ export default {
 
 				(user, next) => {
 					if (!user) return next();
-					if (user._id === updatingUserId) return next();
+					if (user._id.toString() === updatingUserId) return next();
 					return next("That username is already in use.");
 				},
 

+ 2 - 2
backend/logic/punishments.js

@@ -148,9 +148,9 @@ class _PunishmentsModule extends CoreClass {
 									this
 								).finally(() => {
 									WSModule.runJob(
-										"EMIT_TO_ROOM",
+										"EMIT_TO_ROOMS",
 										{
-											room: `admin.punishments`,
+											rooms: [`admin.punishments`, `view-punishment.${punishment.punishmentId}`],
 											args: [
 												"event:admin.punishment.updated",
 												{ data: { punishment: { ...punishment, status: "Inactive" } } }

+ 6 - 3
backend/logic/stations.js

@@ -757,11 +757,14 @@ class _StationsModule extends CoreClass {
 					},
 
 					(station, sockets, next) => {
-						const skipVotes = station.currentSong.skipVotes.length;
+						const skipVotes =
+							station.currentSong && station.currentSong.skipVotes
+								? station.currentSong.skipVotes.length
+								: 0;
 						let shouldSkip = false;
 
-						if (sockets.length <= skipVotes) {
-							if (!station.paused) shouldSkip = true;
+						if (skipVotes === 0) {
+							if (!station.paused && !station.currentSong && station.queue.length > 0) shouldSkip = true;
 							return next(null, shouldSkip);
 						}
 

+ 2 - 2
backend/package-lock.json

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

+ 1 - 1
backend/package.json

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

+ 2 - 2
frontend/package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "musare-frontend",
-  "version": "3.7.0",
+  "version": "3.7.1",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "musare-frontend",
-      "version": "3.7.0",
+      "version": "3.7.1",
       "license": "GPL-3.0",
       "dependencies": {
         "@vitejs/plugin-vue": "^3.0.3",

+ 1 - 1
frontend/package.json

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

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

@@ -1200,8 +1200,8 @@ watch(
 );
 watch(youtubeId, (_youtubeId, _oldYoutubeId) => {
 	console.log("NEW YOUTUBE ID", _youtubeId);
-	unloadSong(_oldYoutubeId);
-	loadSong(_youtubeId);
+	if (_oldYoutubeId) unloadSong(_oldYoutubeId);
+	if (_youtubeId) loadSong(_youtubeId);
 });
 
 onMounted(async () => {

+ 19 - 0
frontend/src/components/modals/ViewPunishment.vue

@@ -28,6 +28,19 @@ const init = () => {
 	socket.dispatch(`punishments.findOne`, punishmentId.value, res => {
 		if (res.status === "success") {
 			viewPunishment(res.data.punishment);
+
+			socket.dispatch(
+				"apis.joinRoom",
+				`view-punishment.${punishmentId.value}`
+			);
+
+			socket.on(
+				"event:admin.punishment.updated",
+				({ data }) => {
+					punishment.value = data.punishment;
+				},
+				{ modalUuid: props.modalUuid }
+			);
 		} else {
 			new Toast("Punishment with that ID not found");
 			closeCurrentModal();
@@ -55,6 +68,12 @@ onMounted(() => {
 });
 
 onBeforeUnmount(() => {
+	socket.dispatch(
+		"apis.leaveRoom",
+		`view-punishment.${punishmentId.value}`,
+		() => {}
+	);
+
 	// Delete the Pinia store that was created for this modal, after all other cleanup tasks are performed
 	viewPunishmentStore.$dispose();
 });