Kaynağa Gözat

chore: updated a bunch of jsdocs, removed comments

Kristian Vos 1 yıl önce
ebeveyn
işleme
5f6d6c917d

+ 3 - 3
backend/logic/actions/spotify.js

@@ -11,7 +11,7 @@ export default {
 	 * Fetches tracks from media sources
 	 *
 	 * @param {object} session - the session object automatically added by the websocket
-	 * @param {array} mediaSources - the media sources to get tracks for
+	 * @param {Array} mediaSources - the media sources to get tracks for
 	 * @returns {{status: string, data: object}}
 	 */
 	getTracksFromMediaSources: useHasPermission(
@@ -42,7 +42,7 @@ export default {
 	 * Fetches albums from ids
 	 *
 	 * @param {object} session - the session object automatically added by the websocket
-	 * @param {array} albumIds - the ids of the Spotify albums to get
+	 * @param {Array} albumIds - the ids of the Spotify albums to get
 	 * @returns {{status: string, data: object}}
 	 */
 	getAlbumsFromIds: useHasPermission("spotify.getAlbumsFromIds", function getAlbumsFromIds(session, albumIds, cb) {
@@ -62,7 +62,7 @@ export default {
 	 * Fetches artists from ids
 	 *
 	 * @param {object} session - the session object automatically added by the websocket
-	 * @param {array} artistIds - the ids of the Spotify artists to get
+	 * @param {Array} artistIds - the ids of the Spotify artists to get
 	 * @returns {{status: string, data: object}}
 	 */
 	getArtistsFromIds: useHasPermission(

+ 2 - 1
backend/logic/actions/youtube.js

@@ -495,7 +495,7 @@ export default {
 	 * Remove YouTube videos
 	 *
 	 * @param {object} session - the session object automatically added by the websocket
-	 * @param {array} videoIds - the YouTube video ids to remove
+	 * @param {Array} videoIds - the YouTube video ids to remove
 	 * @param {Function} cb - gets called with the result
 	 * @returns {{status: string, data: object}}
 	 */
@@ -782,6 +782,7 @@ export default {
 
 	/**
 	 * Gets missing YouTube channels
+	 *
 	 * @param {object} session - the session object automatically added by the websocket
 	 * @param {Function} cb - gets called with the result
 	 * @returns {{status: string, data: object}}

+ 3 - 3
backend/logic/soundcloud.js

@@ -228,7 +228,7 @@ class _SoundCloudModule extends CoreClass {
 	 * Perform SoundCloud API get track request
 	 *
 	 * @param {object} payload - object that contains the payload
-	 * @param {strubg} payload.trackId - the SoundCloud track id to get
+	 * @param {string} payload.trackId - the SoundCloud track id to get
 	 * @returns {Promise} - returns promise (reject, resolve)
 	 */
 	API_GET_TRACK(payload) {
@@ -255,7 +255,7 @@ class _SoundCloudModule extends CoreClass {
 	 * Perform SoundCloud API call
 	 *
 	 * @param {object} payload - object that contains the payload
-	 * @param {strubg} payload.url - request url
+	 * @param {string} payload.url - request url
 	 * @param {object} payload.params - request parameters
 	 * @returns {Promise} - returns promise (reject, resolve)
 	 */
@@ -604,7 +604,7 @@ class _SoundCloudModule extends CoreClass {
 	 * Get Soundcloud artists
 	 *
 	 * @param {object} payload - an object containing the payload
-	 * @param {array} payload.userPermalinks - an array of Soundcloud user permalinks
+	 * @param {Array} payload.userPermalinks - an array of Soundcloud user permalinks
 	 * @returns {Promise} - returns a promise (resolve, reject)
 	 */
 	async GET_ARTISTS_FROM_PERMALINKS(payload) {

+ 8 - 8
backend/logic/spotify.js

@@ -187,7 +187,7 @@ class _SpotifyModule extends CoreClass {
 	 * Perform Spotify API get albums request
 	 *
 	 * @param {object} payload - object that contains the payload
-	 * @param {array} payload.albumIds - the album ids to get
+	 * @param {Array} payload.albumIds - the album ids to get
 	 * @returns {Promise} - returns promise (reject, resolve)
 	 */
 	API_GET_ALBUMS(payload) {
@@ -217,7 +217,7 @@ class _SpotifyModule extends CoreClass {
 	 * Perform Spotify API get artists request
 	 *
 	 * @param {object} payload - object that contains the payload
-	 * @param {array} payload.artistIds - the artist ids to get
+	 * @param {Array} payload.artistIds - the artist ids to get
 	 * @returns {Promise} - returns promise (reject, resolve)
 	 */
 	API_GET_ARTISTS(payload) {
@@ -346,7 +346,7 @@ class _SpotifyModule extends CoreClass {
 	 * Create Spotify track
 	 *
 	 * @param {object} payload - an object containing the payload
-	 * @param {array} payload.spotifyTracks - the spotifyTracks
+	 * @param {Array} payload.spotifyTracks - the spotifyTracks
 	 * @returns {Promise} - returns a promise (resolve, reject)
 	 */
 	CREATE_TRACKS(payload) {
@@ -405,7 +405,7 @@ class _SpotifyModule extends CoreClass {
 	 * Create Spotify albums
 	 *
 	 * @param {object} payload - an object containing the payload
-	 * @param {array} payload.spotifyAlbums - the Spotify albums
+	 * @param {Array} payload.spotifyAlbums - the Spotify albums
 	 * @returns {Promise} - returns a promise (resolve, reject)
 	 */
 	async CREATE_ALBUMS(payload) {
@@ -435,7 +435,7 @@ class _SpotifyModule extends CoreClass {
 	 * Create Spotify artists
 	 *
 	 * @param {object} payload - an object containing the payload
-	 * @param {array} payload.spotifyArtists - the Spotify artists
+	 * @param {Array} payload.spotifyArtists - the Spotify artists
 	 * @returns {Promise} - returns a promise (resolve, reject)
 	 */
 	async CREATE_ARTISTS(payload) {
@@ -465,7 +465,7 @@ class _SpotifyModule extends CoreClass {
 	 * Gets tracks from media sources
 	 *
 	 * @param {object} payload - object that contains the payload
-	 * @param {array} payload.mediaSources - the media sources to get tracks from
+	 * @param {Array} payload.mediaSources - the media sources to get tracks from
 	 * @returns {Promise} - returns promise (reject, resolve)
 	 */
 	async GET_TRACKS_FROM_MEDIA_SOURCES(payload) {
@@ -512,7 +512,7 @@ class _SpotifyModule extends CoreClass {
 	 * Gets albums from Spotify album ids
 	 *
 	 * @param {object} payload - object that contains the payload
-	 * @param {array} payload.albumIds - the Spotify album ids
+	 * @param {Array} payload.albumIds - the Spotify album ids
 	 * @returns {Promise} - returns promise (reject, resolve)
 	 */
 	async GET_ALBUMS_FROM_IDS(payload) {
@@ -555,7 +555,7 @@ class _SpotifyModule extends CoreClass {
 	 * Gets Spotify artists from Spotify artist ids
 	 *
 	 * @param {object} payload - object that contains the payload
-	 * @param {array} payload.artistIds - the Spotify artist ids
+	 * @param {Array} payload.artistIds - the Spotify artist ids
 	 * @returns {Promise} - returns promise (reject, resolve)
 	 */
 	async GET_ARTISTS_FROM_IDS(payload) {

+ 1 - 1
backend/logic/wikidata.js

@@ -98,7 +98,7 @@ class _WikiDataModule extends CoreClass {
 	 * Get WikiData data from work id
 	 *
 	 * @param {object} payload - object that contains the payload
-	 * @param {strubg} payload.workId - work id
+	 * @param {string} payload.workId - work id
 	 * @returns {Promise} - returns promise (reject, resolve)
 	 */
 	async API_GET_DATA_FROM_MUSICBRAINZ_WORK(payload) {

+ 3 - 3
backend/logic/youtube.js

@@ -1327,7 +1327,7 @@ class _YouTubeModule extends CoreClass {
 	 * Create YouTube videos
 	 *
 	 * @param {object} payload - an object containing the payload
-	 * @param {array|object} payload.youtubeVideos - the youtubeVideo object or array of
+	 * @param {Array | object} payload.youtubeVideos - the youtubeVideo object or array of
 	 * @returns {Promise} - returns a promise (resolve, reject)
 	 */
 	CREATE_VIDEOS(payload) {
@@ -1373,7 +1373,7 @@ class _YouTubeModule extends CoreClass {
 	 * Get YouTube videos
 	 *
 	 * @param {object} payload - an object containing the payload
-	 * @param {array} payload.identifiers - an array of YouTube video ObjectId's or YouTube ID's
+	 * @param {Array} payload.identifiers - an array of YouTube video ObjectId's or YouTube ID's
 	 * @param {boolean} payload.createMissing - attempt to fetch and create video's if not in db
 	 * @param {boolean} payload.replaceExisting - replace existing
 	 * @returns {Promise} - returns a promise (resolve, reject)
@@ -1485,7 +1485,7 @@ class _YouTubeModule extends CoreClass {
 	 * Get YouTube channels
 	 *
 	 * @param {object} payload - an object containing the payload
-	 * @param {array} payload.channelIds - an array of YouTube channel id's
+	 * @param {Array} payload.channelIds - an array of YouTube channel id's
 	 * @returns {Promise} - returns a promise (resolve, reject)
 	 */
 	async GET_CHANNELS_FROM_IDS(payload) {

+ 0 - 59
frontend/src/composables/useSearchSoundcloud.ts

@@ -16,63 +16,6 @@ export const useSearchSoundcloud = () => {
 
 	const { socket } = useWebsocketsStore();
 
-	const searchForSongs = () => {
-		// let { query } = soundcloudSearch.value.songs;
-		// if (query.indexOf("&index=") !== -1) {
-		// 	const splitQuery = query.split("&index=");
-		// 	splitQuery.pop();
-		// 	query = splitQuery.join("");
-		// }
-		// if (query.indexOf("&list=") !== -1) {
-		// 	const splitQuery = query.split("&list=");
-		// 	splitQuery.pop();
-		// 	query = splitQuery.join("");
-		// }
-		// socket.dispatch("apis.searchSoundcloud", query, res => {
-		// 	if (res.status === "success") {
-		// 		soundcloudSearch.value.songs.nextPageToken =
-		// 			res.data.nextPageToken;
-		// 		soundcloudSearch.value.songs.results = [];
-		// 		res.data.items.forEach(result => {
-		// 			soundcloudSearch.value.songs.results.push({
-		// 				id: result.id.videoId,
-		// 				url: `https://www.soundcloud.com/watch?v=${result.id.videoId}`,
-		// 				title: result.snippet.title,
-		// 				thumbnail: result.snippet.thumbnails.default.url,
-		// 				channelId: result.snippet.channelId,
-		// 				channelTitle: result.snippet.channelTitle,
-		// 				isAddedToQueue: false
-		// 			});
-		// 		});
-		// 	} else if (res.status === "error") new Toast(res.message);
-		// });
-	};
-
-	const loadMoreSongs = () => {
-		// socket.dispatch(
-		// 	"apis.searchSoundcloudForPage",
-		// 	soundcloudSearch.value.songs.query,
-		// 	soundcloudSearch.value.songs.nextPageToken,
-		// 	res => {
-		// 		if (res.status === "success") {
-		// 			soundcloudSearch.value.songs.nextPageToken =
-		// 				res.data.nextPageToken;
-		// 			res.data.items.forEach(result => {
-		// 				soundcloudSearch.value.songs.results.push({
-		// 					id: result.id.videoId,
-		// 					url: `https://www.soundcloud.com/watch?v=${result.id.videoId}`,
-		// 					title: result.snippet.title,
-		// 					thumbnail: result.snippet.thumbnails.default.url,
-		// 					channelId: result.snippet.channelId,
-		// 					channelTitle: result.snippet.channelTitle,
-		// 					isAddedToQueue: false
-		// 				});
-		// 			});
-		// 		} else if (res.status === "error") new Toast(res.message);
-		// 	}
-		// );
-	};
-
 	const addSoundcloudSongToPlaylist = (playlistId, id, index) => {
 		socket.dispatch(
 			"playlists.addSongToPlaylist",
@@ -90,8 +33,6 @@ export const useSearchSoundcloud = () => {
 
 	return {
 		soundcloudSearch,
-		searchForSongs,
-		loadMoreSongs,
 		addSoundcloudSongToPlaylist
 	};
 };

+ 0 - 59
frontend/src/composables/useSearchSpotify.ts

@@ -16,63 +16,6 @@ export const useSearchSpotify = () => {
 
 	const { socket } = useWebsocketsStore();
 
-	// const searchForSongs = () => {
-	// let { query } = spotifySearch.value.songs;
-	// if (query.indexOf("&index=") !== -1) {
-	// 	const splitQuery = query.split("&index=");
-	// 	splitQuery.pop();
-	// 	query = splitQuery.join("");
-	// }
-	// if (query.indexOf("&list=") !== -1) {
-	// 	const splitQuery = query.split("&list=");
-	// 	splitQuery.pop();
-	// 	query = splitQuery.join("");
-	// }
-	// socket.dispatch("apis.searchSpotify", query, res => {
-	// 	if (res.status === "success") {
-	// 		spotifySearch.value.songs.nextPageToken =
-	// 			res.data.nextPageToken;
-	// 		spotifySearch.value.songs.results = [];
-	// 		res.data.items.forEach(result => {
-	// 			spotifySearch.value.songs.results.push({
-	// 				id: result.id.videoId,
-	// 				url: `https://www.spotify.com/watch?v=${result.id.videoId}`,
-	// 				title: result.snippet.title,
-	// 				thumbnail: result.snippet.thumbnails.default.url,
-	// 				channelId: result.snippet.channelId,
-	// 				channelTitle: result.snippet.channelTitle,
-	// 				isAddedToQueue: false
-	// 			});
-	// 		});
-	// 	} else if (res.status === "error") new Toast(res.message);
-	// });
-	// };
-
-	// const loadMoreSongs = () => {
-	// socket.dispatch(
-	// 	"apis.searchSpotifyForPage",
-	// 	spotifySearch.value.songs.query,
-	// 	spotifySearch.value.songs.nextPageToken,
-	// 	res => {
-	// 		if (res.status === "success") {
-	// 			spotifySearch.value.songs.nextPageToken =
-	// 				res.data.nextPageToken;
-	// 			res.data.items.forEach(result => {
-	// 				spotifySearch.value.songs.results.push({
-	// 					id: result.id.videoId,
-	// 					url: `https://www.spotify.com/watch?v=${result.id.videoId}`,
-	// 					title: result.snippet.title,
-	// 					thumbnail: result.snippet.thumbnails.default.url,
-	// 					channelId: result.snippet.channelId,
-	// 					channelTitle: result.snippet.channelTitle,
-	// 					isAddedToQueue: false
-	// 				});
-	// 			});
-	// 		} else if (res.status === "error") new Toast(res.message);
-	// 	}
-	// );
-	// };
-
 	const addSpotifySongToPlaylist = (playlistId, id, index) => {
 		socket.dispatch(
 			"playlists.addSongToPlaylist",
@@ -90,8 +33,6 @@ export const useSearchSpotify = () => {
 
 	return {
 		spotifySearch,
-		// searchForSongs,
-		// loadMoreSongs,
 		addSpotifySongToPlaylist
 	};
 };

+ 0 - 20
frontend/src/composables/useSpotifyDirect.ts

@@ -45,28 +45,8 @@ export const useSpotifyDirect = () => {
 		}
 	};
 
-	// const addToQueue = (stationId: string) => {
-	// 	const url = spotifyDirect.value.trim();
-
-	// 	socket.dispatch(
-	// 		"stations.addToQueue",
-	// 		stationId,
-	// 		url,
-	// 		"manual",
-	// 		res => {
-	// 			if (res.status !== "success")
-	// 				new Toast(`Error: ${res.message}`);
-	// 			else {
-	// 				new Toast(res.message);
-	// 				spotifyDirect.value = "";
-	// 			}
-	// 		}
-	// 	);
-	// };
-
 	return {
 		spotifyDirect,
 		addToPlaylist
-		// addToQueue
 	};
 };

+ 0 - 3
frontend/src/composables/useYoutubeVideo.ts

@@ -134,8 +134,5 @@ export const useYoutubeVideo = () => {
 		youtubeVideoURLOrID,
 		youtubeVideos,
 		selectYoutubeVideo
-		// searchForSongs,
-		// loadMoreSongs,
-		// addYouTubeSongToPlaylist
 	};
 };

+ 0 - 7
frontend/src/pages/Admin/SoundCloud/Tracks.vue

@@ -225,13 +225,6 @@ const filters = ref<TableFilter[]>([
 		filterTypes: ["datetimeBefore", "datetimeAfter"],
 		defaultFilterType: "datetimeBefore"
 	},
-	// {
-	// 	name: "importJob",
-	// 	displayName: "Import Job",
-	// 	property: "importJob",
-	// 	filterTypes: ["special"],
-	// 	defaultFilterType: "special"
-	// },
 	{
 		name: "genre",
 		displayName: "Genre",