Browse Source

refactor: Import and long job tweaks

Owen Diffey 2 years ago
parent
commit
69aab61284

+ 0 - 3
backend/logic/actions/users.js

@@ -220,11 +220,8 @@ CacheModule.runJob("SUB", {
 CacheModule.runJob("SUB", {
 	channel: "longJob.added",
 	cb: ({ jobId, userId }) => {
-		console.log(1111, jobId, userId);
 		WSModule.runJob("SOCKETS_FROM_USER", { userId }).then(sockets => {
-			console.log(2222, sockets.length);
 			sockets.forEach(socket => {
-				console.log(3333);
 				socket.dispatch("keep.event:longJob.added", {
 					data: {
 						jobId

+ 1 - 11
frontend/src/pages/Admin/Songs/Import.vue

@@ -473,16 +473,6 @@ export default {
 			socket: "websockets/getSocket"
 		})
 	},
-	mounted() {
-		// this.socket.dispatch("youtube.getRequestSetAdminLongJobs", {
-		// 	cb: res => {
-		// 		console.log(111, res);
-		// 	},
-		// 	onProgress: res => {
-		// 		console.log(222, res);
-		// 	}
-		// });
-	},
 	methods: {
 		openAdvancedTable(importJob) {
 			const filter = {
@@ -491,7 +481,7 @@ export default {
 						data: importJob._id,
 						filter: {
 							name: "importJob",
-							displayName: "Import%20job",
+							displayName: "Import Job",
 							property: "importJob",
 							filterTypes: ["special"],
 							defaultFilterType: "special"

+ 1 - 1
frontend/src/pages/Admin/YouTube/Videos.vue

@@ -286,7 +286,7 @@ export default {
 				},
 				{
 					name: "importJob",
-					displayName: "Import job",
+					displayName: "Import Job",
 					property: "importJob",
 					filterTypes: ["special"],
 					defaultFilterType: "special"

+ 3 - 9
frontend/src/store/modules/longJobs.js

@@ -1,14 +1,7 @@
 /* eslint no-param-reassign: 0 */
 
 const state = {
-	activeJobs: [
-		// {
-		// 	id: 1,
-		// 	name: "test",
-		// 	status: "success",
-		// 	message: "test"
-		// }
-	],
+	activeJobs: [],
 	removedJobIds: []
 };
 
@@ -27,7 +20,8 @@ const mutations = {
 				state.activeJobs.push({
 					id,
 					name,
-					status
+					status,
+					message
 				});
 			else
 				state.activeJobs.forEach((activeJob, index) => {

+ 1 - 0
frontend/src/store/modules/modals/importAlbum.js

@@ -33,6 +33,7 @@ export default {
 	},
 	mutations: {
 		init(state, { songs }) {
+			state.originalPlaylistSongs = JSON.parse(JSON.stringify(songs));
 			state.playlistSongs = JSON.parse(JSON.stringify(songs));
 		},
 		showDiscogsTab(state, tab) {