Browse Source

chore: fixed some linting errors

Kristian Vos 2 months ago
parent
commit
0589743a63

+ 4 - 5
backend/logic/youtube.js

@@ -646,7 +646,7 @@ class _YouTubeModule extends CoreClass {
 							? 4
 							: Number.parseInt(config.get("apis.youtube.maxPlaylistPages"));
 
-						next(null, maxPages, playlistInfo.isMix);
+						return next(null, maxPages, playlistInfo.isMix);
 					},
 
 					(maxPages, isMix, next) => {
@@ -667,7 +667,7 @@ class _YouTubeModule extends CoreClass {
 									return next(null, false);
 								}
 
-								next(null, true);
+								return next(null, true);
 							},
 							next => {
 								currentPage += 1;
@@ -721,7 +721,6 @@ class _YouTubeModule extends CoreClass {
 
 	/**
 	 * Returns playlist info
-	 *
 	 * @param {object} payload - object that contains the payload
 	 * @param {string} payload.playlistId - the playlist id
 	 * @returns {Promise} - returns promise (reject, resolve)
@@ -743,7 +742,7 @@ class _YouTubeModule extends CoreClass {
 		const privacyStatus = playlistInfo?.status?.privacyStatus;
 
 		// Another way to possibly check for mix is if the first two letters of the playlist ID starts with RD
-		let isMix =
+		const isMix =
 			channelId === YOUTUBE_OFFICIAL_CHANNEL_ID &&
 			(title?.startsWith(YOUTUBE_MIX_PLAYLIST_TITLE_PREFIX) ||
 				enTitle?.startsWith(YOUTUBE_MIX_PLAYLIST_TITLE_PREFIX));
@@ -1018,7 +1017,7 @@ class _YouTubeModule extends CoreClass {
 	async API_GET_PLAYLIST(payload) {
 		const { params } = payload;
 
-		return await YouTubeModule.runJob(
+		return YouTubeModule.runJob(
 			"API_CALL",
 			{
 				url: "https://www.googleapis.com/youtube/v3/playlists",

+ 2 - 9
frontend/src/components/modals/EditPlaylist/index.vue

@@ -71,7 +71,7 @@ const {
 	addSong,
 	removeSong,
 	replaceSong,
-	reorderSongsList,
+	reorderSongsList
 } = editPlaylistStore;
 
 const { closeCurrentModal, openModal } = useModalsStore();
@@ -109,14 +109,7 @@ const repositionSong = ({ moved }) => {
 			oldIndex,
 			newIndex
 		},
-		res => {
-			if (res.status !== "success")
-				repositionedSong({
-					...song,
-					newIndex: oldIndex,
-					oldIndex: newIndex
-				});
-		}
+		() => {}
 	);
 };
 

+ 1 - 1
frontend/src/stores/editPlaylist.ts

@@ -45,9 +45,9 @@ export const useEditPlaylistStore = ({ modalUuid }: { modalUuid: string }) =>
 					const indexB = songsOrder.findIndex(
 						mediaSource => mediaSource === songB.mediaSource
 					);
-					if (indexA === indexB) return 0;
 					if (indexA > indexB) return 1;
 					if (indexA < indexB) return -1;
+					return 0;
 				});
 			}
 		}

+ 1 - 1
frontend/src/stores/manageStation.ts

@@ -72,9 +72,9 @@ export const useManageStationStore = ({ modalUuid }: { modalUuid: string }) =>
 					const indexB = songsOrder.findIndex(
 						mediaSource => mediaSource === songB.mediaSource
 					);
-					if (indexA === indexB) return 0;
 					if (indexA > indexB) return 1;
 					if (indexA < indexB) return -1;
+					return 0;
 				});
 			},
 			updateStationPaused(stationPaused) {

+ 1 - 1
frontend/src/stores/station.ts

@@ -162,9 +162,9 @@ export const useStationStore = defineStore("station", {
 				const indexB = songsOrder.findIndex(
 					mediaSource => mediaSource === songB.mediaSource
 				);
-				if (indexA === indexB) return 0;
 				if (indexA > indexB) return 1;
 				if (indexA < indexB) return -1;
+				return 0;
 			});
 		},
 		updateStationPaused(stationPaused) {