Browse Source

refactor: fixed eslint issues

Kristian Vos 3 years ago
parent
commit
2190f53838

+ 2 - 1
frontend/.eslintrc

@@ -41,6 +41,7 @@
 			"error"
 			"error"
 		],
 		],
 		"vue/order-in-components": 2,
 		"vue/order-in-components": 2,
-		"vue/no-v-for-template-key": 0
+		"vue/no-v-for-template-key": 0,
+		"vue/multi-word-component-names": 0
 	}
 	}
 }
 }

+ 2 - 6
frontend/src/App.vue

@@ -210,18 +210,14 @@ export default {
 		this.$router.isReady().then(() => {
 		this.$router.isReady().then(() => {
 			if (this.$route.query.err) {
 			if (this.$route.query.err) {
 				let { err } = this.$route.query;
 				let { err } = this.$route.query;
-				err = err
-					.replace(new RegExp("<", "g"), "&lt;")
-					.replace(new RegExp(">", "g"), "&gt;");
+				err = err.replace(/</g, "&lt;").replace(/>/g, "&gt;");
 				this.$router.push({ query: {} });
 				this.$router.push({ query: {} });
 				new Toast({ content: err, timeout: 20000 });
 				new Toast({ content: err, timeout: 20000 });
 			}
 			}
 
 
 			if (this.$route.query.msg) {
 			if (this.$route.query.msg) {
 				let { msg } = this.$route.query;
 				let { msg } = this.$route.query;
-				msg = msg
-					.replace(new RegExp("<", "g"), "&lt;")
-					.replace(new RegExp(">", "g"), "&gt;");
+				msg = msg.replace(/</g, "&lt;").replace(/>/g, "&gt;");
 				this.$router.push({ query: {} });
 				this.$router.push({ query: {} });
 				new Toast({ content: msg, timeout: 20000 });
 				new Toast({ content: msg, timeout: 20000 });
 			}
 			}

+ 3 - 3
frontend/src/api/admin/reports.js

@@ -5,13 +5,13 @@ import ws from "@/ws";
 
 
 export default {
 export default {
 	resolve(reportId) {
 	resolve(reportId) {
-		return new Promise((resolve, reject) =>
+		return new Promise((resolve, reject) => {
 			ws.socket.dispatch("reports.resolve", reportId, res => {
 			ws.socket.dispatch("reports.resolve", reportId, res => {
 				new Toast(res.message);
 				new Toast(res.message);
 				if (res.status === "success")
 				if (res.status === "success")
 					return resolve({ status: "success" });
 					return resolve({ status: "success" });
 				return reject(new Error(res.message));
 				return reject(new Error(res.message));
-			})
-		);
+			});
+		});
 	}
 	}
 };
 };

+ 4 - 18
frontend/src/components/AdvancedTable.vue

@@ -70,11 +70,7 @@
 							<div
 							<div
 								v-for="(filter, index) in editingFilters"
 								v-for="(filter, index) in editingFilters"
 								:key="`filter-${index}`"
 								:key="`filter-${index}`"
-								class="
-									advanced-filter
-									control
-									is-grouped is-expanded
-								"
+								class="advanced-filter control is-grouped is-expanded"
 							>
 							>
 								<div class="control select">
 								<div class="control select">
 									<select
 									<select
@@ -228,10 +224,7 @@
 										@click="applyFilterAndGetData()"
 										@click="applyFilterAndGetData()"
 									>
 									>
 										<i
 										<i
-											class="
-												material-icons
-												icon-with-button
-											"
+											class="material-icons icon-with-button"
 											>filter_list</i
 											>filter_list</i
 										>
 										>
 										Apply filters
 										Apply filters
@@ -248,10 +241,7 @@
 										@click="applyFilterAndGetData()"
 										@click="applyFilterAndGetData()"
 									>
 									>
 										<i
 										<i
-											class="
-												material-icons
-												icon-with-button
-											"
+											class="material-icons icon-with-button"
 											>filter_list</i
 											>filter_list</i
 										>
 										>
 										Apply filters
 										Apply filters
@@ -372,11 +362,7 @@
 										"
 										"
 									>
 									>
 										<p
 										<p
-											class="
-												control
-												is-expanded
-												checkbox-control
-											"
+											class="control is-expanded checkbox-control"
 										>
 										>
 											<label class="switch">
 											<label class="switch">
 												<input
 												<input

+ 1 - 4
frontend/src/components/SongItem.vue

@@ -109,10 +109,7 @@
 							>
 							>
 								<template #button>
 								<template #button>
 									<i
 									<i
-										class="
-											material-icons
-											add-to-playlist-icon
-										"
+										class="material-icons add-to-playlist-icon"
 										content="Add Song to Playlist"
 										content="Add Song to Playlist"
 										v-tippy
 										v-tippy
 										>playlist_add</i
 										>playlist_add</i

+ 1 - 1
frontend/src/components/modals/EditPlaylist/Tabs/ImportPlaylists.vue

@@ -58,7 +58,7 @@ export default {
 			if (!this.youtubeSearch.playlist.query)
 			if (!this.youtubeSearch.playlist.query)
 				return new Toast("Please enter a YouTube playlist URL.");
 				return new Toast("Please enter a YouTube playlist URL.");
 
 
-			const regex = new RegExp(`[\\?&]list=([^&#]*)`);
+			const regex = /`[\\?&]list=([^&#]*)`/;
 			const splitQuery = regex.exec(this.youtubeSearch.playlist.query);
 			const splitQuery = regex.exec(this.youtubeSearch.playlist.query);
 
 
 			if (!splitQuery) {
 			if (!splitQuery) {

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

@@ -113,10 +113,7 @@
 									>
 									>
 										<template #tippyActions>
 										<template #tippyActions>
 											<i
 											<i
-												class="
-													material-icons
-													add-to-queue-icon
-												"
+												class="material-icons add-to-queue-icon"
 												v-if="
 												v-if="
 													station.partyMode &&
 													station.partyMode &&
 													!station.locked
 													!station.locked
@@ -144,10 +141,7 @@
 												"
 												"
 											>
 											>
 												<i
 												<i
-													class="
-														material-icons
-														delete-icon
-													"
+													class="material-icons delete-icon"
 													content="Remove Song from Playlist"
 													content="Remove Song from Playlist"
 													v-tippy
 													v-tippy
 													>delete_forever</i
 													>delete_forever</i

+ 1 - 1
frontend/src/components/modals/EditSong/Tabs/Discogs.vue

@@ -202,7 +202,7 @@ export default {
 					.then(data => {
 					.then(data => {
 						apiResult.album.artists = [];
 						apiResult.album.artists = [];
 						apiResult.album.artistIds = [];
 						apiResult.album.artistIds = [];
-						const artistRegex = new RegExp(" \\([0-9]+\\)$");
+						const artistRegex = /" \\([0-9]+\\)$"/;
 
 
 						apiResult.dataQuality = data.data_quality;
 						apiResult.dataQuality = data.data_quality;
 						data.artists.forEach(artist => {
 						data.artists.forEach(artist => {

+ 4 - 18
frontend/src/components/modals/EditSong/Tabs/Reports.vue

@@ -50,11 +50,7 @@
 							:key="issueIndex"
 							:key="issueIndex"
 						>
 						>
 							<i
 							<i
-								class="
-									material-icons
-									duration-icon
-									report-sub-item-left-icon
-								"
+								class="material-icons duration-icon report-sub-item-left-icon"
 								:content="issue.category"
 								:content="issue.category"
 								v-tippy
 								v-tippy
 							>
 							>
@@ -74,10 +70,7 @@
 							</p>
 							</p>
 
 
 							<div
 							<div
-								class="
-									report-sub-item-actions
-									universal-item-actions
-								"
+								class="report-sub-item-actions universal-item-actions"
 							>
 							>
 								<i
 								<i
 									class="material-icons resolve-icon"
 									class="material-icons resolve-icon"
@@ -145,11 +138,7 @@
 							:key="issueIndex"
 							:key="issueIndex"
 						>
 						>
 							<i
 							<i
-								class="
-									material-icons
-									duration-icon
-									report-sub-item-left-icon
-								"
+								class="material-icons duration-icon report-sub-item-left-icon"
 								:content="issue.category"
 								:content="issue.category"
 								v-tippy
 								v-tippy
 							>
 							>
@@ -168,10 +157,7 @@
 							</p>
 							</p>
 
 
 							<div
 							<div
-								class="
-									report-sub-item-actions
-									universal-item-actions
-								"
+								class="report-sub-item-actions universal-item-actions"
 							>
 							>
 								<i
 								<i
 									class="material-icons resolve-icon"
 									class="material-icons resolve-icon"

+ 6 - 11
frontend/src/components/modals/EditSong/index.vue

@@ -511,12 +511,7 @@
 							</button>
 							</button>
 						</quick-confirm>
 						</quick-confirm>
 						<button
 						<button
-							class="
-								button
-								is-danger
-								icon-with-button
-								material-icons
-							"
+							class="button is-danger icon-with-button material-icons"
 							@click.prevent="
 							@click.prevent="
 								confirmAction({
 								confirmAction({
 									message:
 									message:
@@ -1320,9 +1315,9 @@ export default {
 			error = undefined;
 			error = undefined;
 			song.tags.forEach(tag => {
 			song.tags.forEach(tag => {
 				if (
 				if (
-					!new RegExp(
-						/^[a-zA-Z0-9_]{1,64}$|^[a-zA-Z0-9_]{1,64}\[[a-zA-Z0-9_]{1,64}\]$/
-					).test(tag)
+					!/^[a-zA-Z0-9_]{1,64}$|^[a-zA-Z0-9_]{1,64}\[[a-zA-Z0-9_]{1,64}\]$/.test(
+						tag
+					)
 				) {
 				) {
 					error = "Invalid tag format.";
 					error = "Invalid tag format.";
 					return error;
 					return error;
@@ -1440,8 +1435,6 @@ export default {
 		},
 		},
 		settings(type) {
 		settings(type) {
 			switch (type) {
 			switch (type) {
-				default:
-					break;
 				case "stop":
 				case "stop":
 					this.stopVideo();
 					this.stopVideo();
 					this.pauseVideo(true);
 					this.pauseVideo(true);
@@ -1459,6 +1452,8 @@ export default {
 						this.song.duration - 10 + this.song.skipDuration
 						this.song.duration - 10 + this.song.skipDuration
 					);
 					);
 					break;
 					break;
+				default:
+					break;
 			}
 			}
 		},
 		},
 		play() {
 		play() {

+ 7 - 35
frontend/src/components/modals/EditSongs.vue

@@ -59,11 +59,7 @@
 								<template #leftIcon>
 								<template #leftIcon>
 									<i
 									<i
 										v-if="currentSong._id === song._id"
 										v-if="currentSong._id === song._id"
-										class="
-											material-icons
-											item-icon
-											editing-icon
-										"
+										class="material-icons item-icon editing-icon"
 										content="Currently editing song"
 										content="Currently editing song"
 										v-tippy="{ theme: 'info' }"
 										v-tippy="{ theme: 'info' }"
 										@click="toggleDone(index)"
 										@click="toggleDone(index)"
@@ -71,22 +67,14 @@
 									>
 									>
 									<i
 									<i
 										v-else-if="song.removed"
 										v-else-if="song.removed"
-										class="
-											material-icons
-											item-icon
-											removed-icon
-										"
+										class="material-icons item-icon removed-icon"
 										content="Song removed"
 										content="Song removed"
 										v-tippy="{ theme: 'info' }"
 										v-tippy="{ theme: 'info' }"
 										>delete_forever</i
 										>delete_forever</i
 									>
 									>
 									<i
 									<i
 										v-else-if="status === 'error'"
 										v-else-if="status === 'error'"
-										class="
-											material-icons
-											item-icon
-											error-icon
-										"
+										class="material-icons item-icon error-icon"
 										content="Error saving song"
 										content="Error saving song"
 										v-tippy="{ theme: 'info' }"
 										v-tippy="{ theme: 'info' }"
 										@click="toggleDone(index)"
 										@click="toggleDone(index)"
@@ -94,22 +82,14 @@
 									>
 									>
 									<i
 									<i
 										v-else-if="status === 'saving'"
 										v-else-if="status === 'saving'"
-										class="
-											material-icons
-											item-icon
-											saving-icon
-										"
+										class="material-icons item-icon saving-icon"
 										content="Currently saving song"
 										content="Currently saving song"
 										v-tippy="{ theme: 'info' }"
 										v-tippy="{ theme: 'info' }"
 										>pending</i
 										>pending</i
 									>
 									>
 									<i
 									<i
 										v-else-if="flagged"
 										v-else-if="flagged"
-										class="
-											material-icons
-											item-icon
-											flag-icon
-										"
+										class="material-icons item-icon flag-icon"
 										content="Song flagged"
 										content="Song flagged"
 										v-tippy="{ theme: 'info' }"
 										v-tippy="{ theme: 'info' }"
 										@click="toggleDone(index)"
 										@click="toggleDone(index)"
@@ -117,11 +97,7 @@
 									>
 									>
 									<i
 									<i
 										v-else-if="status === 'done'"
 										v-else-if="status === 'done'"
-										class="
-											material-icons
-											item-icon
-											done-icon
-										"
+										class="material-icons item-icon done-icon"
 										content="Song marked complete"
 										content="Song marked complete"
 										v-tippy="{ theme: 'info' }"
 										v-tippy="{ theme: 'info' }"
 										@click="toggleDone(index)"
 										@click="toggleDone(index)"
@@ -129,11 +105,7 @@
 									>
 									>
 									<i
 									<i
 										v-else-if="status === 'todo'"
 										v-else-if="status === 'todo'"
-										class="
-											material-icons
-											item-icon
-											todo-icon
-										"
+										class="material-icons item-icon todo-icon"
 										content="Song marked todo"
 										content="Song marked todo"
 										v-tippy="{ theme: 'info' }"
 										v-tippy="{ theme: 'info' }"
 										@click="toggleDone(index)"
 										@click="toggleDone(index)"

+ 3 - 7
frontend/src/components/modals/ImportAlbum.vue

@@ -149,11 +149,7 @@
 								!discogs.disableLoadMore &&
 								!discogs.disableLoadMore &&
 								discogs.page < discogs.pages
 								discogs.page < discogs.pages
 							"
 							"
-							class="
-								button
-								is-fullwidth is-info
-								discogs-load-more
-							"
+							class="button is-fullwidth is-info discogs-load-more"
 							@click="loadNextDiscogsPage()"
 							@click="loadNextDiscogsPage()"
 						>
 						>
 							Load more...
 							Load more...
@@ -470,7 +466,7 @@ export default {
 			if (!this.search.playlist.query)
 			if (!this.search.playlist.query)
 				return new Toast("Please enter a YouTube playlist URL.");
 				return new Toast("Please enter a YouTube playlist URL.");
 
 
-			const regex = new RegExp(`[\\?&]list=([^&#]*)`);
+			const regex = /`[\\?&]list=([^&#]*)`/;
 			const splitQuery = regex.exec(this.search.playlist.query);
 			const splitQuery = regex.exec(this.search.playlist.query);
 
 
 			if (!splitQuery) {
 			if (!splitQuery) {
@@ -561,7 +557,7 @@ export default {
 					.then(data => {
 					.then(data => {
 						apiResult.album.artists = [];
 						apiResult.album.artists = [];
 						apiResult.album.artistIds = [];
 						apiResult.album.artistIds = [];
-						const artistRegex = new RegExp(" \\([0-9]+\\)$");
+						const artistRegex = /" \\([0-9]+\\)$"/;
 
 
 						apiResult.dataQuality = data.data_quality;
 						apiResult.dataQuality = data.data_quality;
 						data.artists.forEach(artist => {
 						data.artists.forEach(artist => {

+ 2 - 8
frontend/src/components/modals/ManageStation/Tabs/Songs.vue

@@ -75,10 +75,7 @@
 												song.youtubeId
 												song.youtubeId
 											) !== -1
 											) !== -1
 										"
 										"
-										class="
-											material-icons
-											added-to-playlist-icon
-										"
+										class="material-icons added-to-playlist-icon"
 										content="Song is already in queue"
 										content="Song is already in queue"
 										v-tippy
 										v-tippy
 										>done</i
 										>done</i
@@ -148,10 +145,7 @@
 											songsInQueue.indexOf(result.id) !==
 											songsInQueue.indexOf(result.id) !==
 											-1
 											-1
 										"
 										"
-										class="
-											material-icons
-											added-to-playlist-icon
-										"
+										class="material-icons added-to-playlist-icon"
 										content="Song is already in queue"
 										content="Song is already in queue"
 										v-tippy
 										v-tippy
 										>done</i
 										>done</i

+ 2 - 10
frontend/src/components/modals/Report.vue

@@ -89,10 +89,7 @@
 											@click="customIssues.push('')"
 											@click="customIssues.push('')"
 										>
 										>
 											<i
 											<i
-												class="
-													material-icons
-													icon-with-button
-												"
+												class="material-icons icon-with-button"
 												>add</i
 												>add</i
 											>
 											>
 											<span> Add Custom Issue </span>
 											<span> Add Custom Issue </span>
@@ -100,12 +97,7 @@
 									</div>
 									</div>
 
 
 									<div
 									<div
-										class="
-											custom-issue
-											control
-											is-grouped
-											input-with-button
-										"
+										class="custom-issue control is-grouped input-with-button"
 										v-for="(issue, index) in customIssues"
 										v-for="(issue, index) in customIssues"
 										:key="index"
 										:key="index"
 									>
 									>

+ 1 - 1
frontend/src/components/modals/RequestSong.vue

@@ -194,7 +194,7 @@ export default {
 			if (!this.youtubeSearch.playlist.query)
 			if (!this.youtubeSearch.playlist.query)
 				return new Toast("Please enter a YouTube playlist URL.");
 				return new Toast("Please enter a YouTube playlist URL.");
 
 
-			const regex = new RegExp(`[\\?&]list=([^&#]*)`);
+			const regex = /`[\\?&]list=([^&#]*)`/;
 			const splitQuery = regex.exec(this.youtubeSearch.playlist.query);
 			const splitQuery = regex.exec(this.youtubeSearch.playlist.query);
 
 
 			if (!splitQuery) {
 			if (!splitQuery) {

+ 2 - 9
frontend/src/components/modals/ViewReport.vue

@@ -28,11 +28,7 @@
 						:key="issueIndex"
 						:key="issueIndex"
 					>
 					>
 						<i
 						<i
-							class="
-								material-icons
-								duration-icon
-								report-sub-item-left-icon
-							"
+							class="material-icons duration-icon report-sub-item-left-icon"
 							:content="issue.category"
 							:content="issue.category"
 							v-tippy
 							v-tippy
 						>
 						>
@@ -51,10 +47,7 @@
 						</p>
 						</p>
 
 
 						<div
 						<div
-							class="
-								report-sub-item-actions
-								universal-item-actions
-							"
+							class="report-sub-item-actions universal-item-actions"
 						>
 						>
 							<i
 							<i
 								class="material-icons resolve-icon"
 								class="material-icons resolve-icon"

+ 2 - 12
frontend/src/pages/Admin/tabs/News.vue

@@ -19,12 +19,7 @@
 				<template #column-options="slotProps">
 				<template #column-options="slotProps">
 					<div class="row-options">
 					<div class="row-options">
 						<button
 						<button
-							class="
-								button
-								is-primary
-								icon-with-button
-								material-icons
-							"
+							class="button is-primary icon-with-button material-icons"
 							@click="edit(slotProps.item._id)"
 							@click="edit(slotProps.item._id)"
 							content="Edit News"
 							content="Edit News"
 							v-tippy
 							v-tippy
@@ -36,12 +31,7 @@
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 						>
 						>
 							<button
 							<button
-								class="
-									button
-									is-danger
-									icon-with-button
-									material-icons
-								"
+								class="button is-danger icon-with-button material-icons"
 								content="Remove News"
 								content="Remove News"
 								v-tippy
 								v-tippy
 							>
 							>

+ 1 - 6
frontend/src/pages/Admin/tabs/Playlists.vue

@@ -16,12 +16,7 @@
 				<template #column-options="slotProps">
 				<template #column-options="slotProps">
 					<div class="row-options">
 					<div class="row-options">
 						<button
 						<button
-							class="
-								button
-								is-primary
-								icon-with-button
-								material-icons
-							"
+							class="button is-primary icon-with-button material-icons"
 							@click="edit(slotProps.item._id)"
 							@click="edit(slotProps.item._id)"
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 							content="Edit Playlist"
 							content="Edit Playlist"

+ 1 - 6
frontend/src/pages/Admin/tabs/Punishments.vue

@@ -13,12 +13,7 @@
 				<template #column-options="slotProps">
 				<template #column-options="slotProps">
 					<div class="row-options">
 					<div class="row-options">
 						<button
 						<button
-							class="
-								button
-								is-primary
-								icon-with-button
-								material-icons
-							"
+							class="button is-primary icon-with-button material-icons"
 							@click="view(slotProps.item._id)"
 							@click="view(slotProps.item._id)"
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 							content="View Punishment"
 							content="View Punishment"

+ 2 - 12
frontend/src/pages/Admin/tabs/Reports.vue

@@ -14,12 +14,7 @@
 				<template #column-options="slotProps">
 				<template #column-options="slotProps">
 					<div class="row-options">
 					<div class="row-options">
 						<button
 						<button
-							class="
-								button
-								is-primary
-								icon-with-button
-								material-icons
-							"
+							class="button is-primary icon-with-button material-icons"
 							@click="view(slotProps.item._id)"
 							@click="view(slotProps.item._id)"
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 							content="View Report"
 							content="View Report"
@@ -28,12 +23,7 @@
 							open_in_full
 							open_in_full
 						</button>
 						</button>
 						<button
 						<button
-							class="
-								button
-								is-success
-								icon-with-button
-								material-icons
-							"
+							class="button is-success icon-with-button material-icons"
 							@click="resolve(slotProps.item._id)"
 							@click="resolve(slotProps.item._id)"
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 							content="Resolve Report"
 							content="Resolve Report"

+ 7 - 29
frontend/src/pages/Admin/tabs/Songs.vue

@@ -28,12 +28,7 @@
 				<template #column-options="slotProps">
 				<template #column-options="slotProps">
 					<div class="row-options">
 					<div class="row-options">
 						<button
 						<button
-							class="
-								button
-								is-primary
-								icon-with-button
-								material-icons
-							"
+							class="button is-primary icon-with-button material-icons"
 							@click="editOne(slotProps.item)"
 							@click="editOne(slotProps.item)"
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 							content="Edit Song"
 							content="Edit Song"
@@ -46,12 +41,7 @@
 							@confirm="unverifyOne(slotProps.item._id)"
 							@confirm="unverifyOne(slotProps.item._id)"
 						>
 						>
 							<button
 							<button
-								class="
-									button
-									is-danger
-									icon-with-button
-									material-icons
-								"
+								class="button is-danger icon-with-button material-icons"
 								:disabled="slotProps.item.removed"
 								:disabled="slotProps.item.removed"
 								content="Unverify Song"
 								content="Unverify Song"
 								v-tippy
 								v-tippy
@@ -61,12 +51,7 @@
 						</quick-confirm>
 						</quick-confirm>
 						<button
 						<button
 							v-else
 							v-else
-							class="
-								button
-								is-success
-								icon-with-button
-								material-icons
-							"
+							class="button is-success icon-with-button material-icons"
 							@click="verifyOne(slotProps.item._id)"
 							@click="verifyOne(slotProps.item._id)"
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 							content="Verify Song"
 							content="Verify Song"
@@ -75,12 +60,7 @@
 							check_circle
 							check_circle
 						</button>
 						</button>
 						<button
 						<button
-							class="
-								button
-								is-danger
-								icon-with-button
-								material-icons
-							"
+							class="button is-danger icon-with-button material-icons"
 							@click.prevent="
 							@click.prevent="
 								confirmAction({
 								confirmAction({
 									message:
 									message:
@@ -722,9 +702,7 @@ export default {
 				name: "tags",
 				name: "tags",
 				action: "songs.editTags",
 				action: "songs.editTags",
 				items: selectedRows.map(row => row._id),
 				items: selectedRows.map(row => row._id),
-				regex: new RegExp(
-					/^[a-zA-Z0-9_]{1,64}$|^[a-zA-Z0-9_]{1,64}\[[a-zA-Z0-9_]{1,64}\]$/
-				),
+				regex: /^[a-zA-Z0-9_]{1,64}$|^[a-zA-Z0-9_]{1,64}\[[a-zA-Z0-9_]{1,64}\]$/,
 				autosuggest: true,
 				autosuggest: true,
 				autosuggestDataAction: "songs.getTags"
 				autosuggestDataAction: "songs.getTags"
 			};
 			};
@@ -735,7 +713,7 @@ export default {
 				name: "artists",
 				name: "artists",
 				action: "songs.editArtists",
 				action: "songs.editArtists",
 				items: selectedRows.map(row => row._id),
 				items: selectedRows.map(row => row._id),
-				regex: new RegExp(/^(?=.{1,64}$).*$/),
+				regex: /^(?=.{1,64}$).*$/,
 				autosuggest: true,
 				autosuggest: true,
 				autosuggestDataAction: "songs.getArtists"
 				autosuggestDataAction: "songs.getArtists"
 			};
 			};
@@ -746,7 +724,7 @@ export default {
 				name: "genres",
 				name: "genres",
 				action: "songs.editGenres",
 				action: "songs.editGenres",
 				items: selectedRows.map(row => row._id),
 				items: selectedRows.map(row => row._id),
-				regex: new RegExp(/^[\x00-\x7F]{1,32}$/),
+				regex: /^[\x00-\x7F]{1,32}$/,
 				autosuggest: true,
 				autosuggest: true,
 				autosuggestDataAction: "songs.getGenres"
 				autosuggestDataAction: "songs.getGenres"
 			};
 			};

+ 2 - 12
frontend/src/pages/Admin/tabs/Stations.vue

@@ -22,12 +22,7 @@
 				<template #column-options="slotProps">
 				<template #column-options="slotProps">
 					<div class="row-options">
 					<div class="row-options">
 						<button
 						<button
-							class="
-								button
-								is-primary
-								icon-with-button
-								material-icons
-							"
+							class="button is-primary icon-with-button material-icons"
 							@click="edit(slotProps.item._id)"
 							@click="edit(slotProps.item._id)"
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 							content="Manage Station"
 							content="Manage Station"
@@ -40,12 +35,7 @@
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 						>
 						>
 							<button
 							<button
-								class="
-									button
-									is-danger
-									icon-with-button
-									material-icons
-								"
+								class="button is-danger icon-with-button material-icons"
 								content="Remove Station"
 								content="Remove Station"
 								v-tippy
 								v-tippy
 							>
 							>

+ 2 - 12
frontend/src/pages/Admin/tabs/Users.vue

@@ -22,12 +22,7 @@
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 						>
 						>
 							<button
 							<button
-								class="
-									button
-									is-success
-									icon-with-button
-									material-icons
-								"
+								class="button is-success icon-with-button material-icons"
 								content="Resolve Data Request"
 								content="Resolve Data Request"
 								v-tippy
 								v-tippy
 							>
 							>
@@ -76,12 +71,7 @@
 				<template #column-options="slotProps">
 				<template #column-options="slotProps">
 					<div class="row-options">
 					<div class="row-options">
 						<button
 						<button
-							class="
-								button
-								is-primary
-								icon-with-button
-								material-icons
-							"
+							class="button is-primary icon-with-button material-icons"
 							@click="edit(slotProps.item._id)"
 							@click="edit(slotProps.item._id)"
 							:disabled="slotProps.item.removed"
 							:disabled="slotProps.item.removed"
 							content="Edit User"
 							content="Edit User"

+ 3 - 12
frontend/src/pages/Home.vue

@@ -68,10 +68,7 @@
 									<div class="icon-container">
 									<div class="icon-container">
 										<div
 										<div
 											v-if="isOwnerOrAdmin(element)"
 											v-if="isOwnerOrAdmin(element)"
-											class="
-												material-icons
-												manage-station
-											"
+											class="material-icons manage-station"
 											@click.prevent="
 											@click.prevent="
 												manageStation(element._id)
 												manageStation(element._id)
 											"
 											"
@@ -82,10 +79,7 @@
 										</div>
 										</div>
 										<div
 										<div
 											v-else
 											v-else
-											class="
-												material-icons
-												manage-station
-											"
+											class="material-icons manage-station"
 											@click.prevent="
 											@click.prevent="
 												manageStation(element._id)
 												manageStation(element._id)
 											"
 											"
@@ -127,10 +121,7 @@
 										<h5>{{ element.displayName }}</h5>
 										<h5>{{ element.displayName }}</h5>
 										<i
 										<i
 											v-if="element.type === 'official'"
 											v-if="element.type === 'official'"
-											class="
-												material-icons
-												verified-station
-											"
+											class="material-icons verified-station"
 											content="Verified Station"
 											content="Verified Station"
 											v-tippy="{
 											v-tippy="{
 												theme: 'info'
 												theme: 'info'

+ 4 - 18
frontend/src/pages/ResetPassword.vue

@@ -39,11 +39,7 @@
 
 
 								<div class="content-box-inputs">
 								<div class="content-box-inputs">
 									<div
 									<div
-										class="
-											control
-											is-grouped
-											input-with-button
-										"
+										class="control is-grouped input-with-button"
 									>
 									>
 										<p class="control is-expanded">
 										<p class="control is-expanded">
 											<input
 											<input
@@ -63,10 +59,7 @@
 												@click="submitEmail()"
 												@click="submitEmail()"
 											>
 											>
 												<i
 												<i
-													class="
-														material-icons
-														icon-with-button
-													"
+													class="material-icons icon-with-button"
 													>mail</i
 													>mail</i
 												>Request
 												>Request
 											</button>
 											</button>
@@ -108,11 +101,7 @@
 
 
 								<div class="content-box-inputs">
 								<div class="content-box-inputs">
 									<div
 									<div
-										class="
-											control
-											is-grouped
-											input-with-button
-										"
+										class="control is-grouped input-with-button"
 									>
 									>
 										<p class="control is-expanded">
 										<p class="control is-expanded">
 											<input
 											<input
@@ -130,10 +119,7 @@
 												@click="verifyCode()"
 												@click="verifyCode()"
 											>
 											>
 												<i
 												<i
-													class="
-														material-icons
-														icon-with-button
-													"
+													class="material-icons icon-with-button"
 													>vpn_key</i
 													>vpn_key</i
 												>Verify
 												>Verify
 											</button>
 											</button>

+ 19 - 80
frontend/src/pages/Station/index.vue

@@ -323,10 +323,7 @@
 										v-tippy
 										v-tippy
 									>
 									>
 										<i
 										<i
-											class="
-												material-icons
-												icon-with-button
-											"
+											class="material-icons icon-with-button"
 										>
 										>
 											bug_report
 											bug_report
 										</i>
 										</i>
@@ -362,10 +359,7 @@
 										v-tippy
 										v-tippy
 									>
 									>
 										<i
 										<i
-											class="
-												material-icons
-												icon-with-button
-											"
+											class="material-icons icon-with-button"
 											>skip_next</i
 											>skip_next</i
 										>
 										>
 									</button>
 									</button>
@@ -377,10 +371,7 @@
 										v-tippy
 										v-tippy
 									>
 									>
 										<i
 										<i
-											class="
-												material-icons
-												icon-with-button
-											"
+											class="material-icons icon-with-button"
 											>skip_next</i
 											>skip_next</i
 										>
 										>
 										{{ currentSong.skipVotes }}
 										{{ currentSong.skipVotes }}
@@ -392,10 +383,7 @@
 										v-tippy="{ theme: 'info' }"
 										v-tippy="{ theme: 'info' }"
 									>
 									>
 										<i
 										<i
-											class="
-												material-icons
-												icon-with-button
-											"
+											class="material-icons icon-with-button"
 											>skip_next</i
 											>skip_next</i
 										>
 										>
 										{{ currentSong.skipVotes }}
 										{{ currentSong.skipVotes }}
@@ -464,10 +452,7 @@
 											v-tippy
 											v-tippy
 										>
 										>
 											<i
 											<i
-												class="
-													material-icons
-													icon-with-button
-												"
+												class="material-icons icon-with-button"
 												:class="{
 												:class="{
 													liked: currentSong.liked
 													liked: currentSong.liked
 												}"
 												}"
@@ -477,21 +462,14 @@
 
 
 										<!-- Dislike Song Button -->
 										<!-- Dislike Song Button -->
 										<button
 										<button
-											class="
-												button
-												is-danger
-												dislike-song
-											"
+											class="button is-danger dislike-song"
 											id="dislike-song"
 											id="dislike-song"
 											@click="toggleDislike()"
 											@click="toggleDislike()"
 											content="Dislike Song"
 											content="Dislike Song"
 											v-tippy
 											v-tippy
 										>
 										>
 											<i
 											<i
-												class="
-													material-icons
-													icon-with-button
-												"
+												class="material-icons icon-with-button"
 												:class="{
 												:class="{
 													disliked:
 													disliked:
 														currentSong.disliked
 														currentSong.disliked
@@ -503,42 +481,26 @@
 									<div id="ratings" class="disabled" v-else>
 									<div id="ratings" class="disabled" v-else>
 										<!-- Like Song Button -->
 										<!-- Like Song Button -->
 										<button
 										<button
-											class="
-												button
-												is-success
-												like-song
-												disabled
-											"
+											class="button is-success like-song disabled"
 											id="like-song"
 											id="like-song"
 											content="Ratings have not been loaded yet"
 											content="Ratings have not been loaded yet"
 											v-tippy
 											v-tippy
 										>
 										>
 											<i
 											<i
-												class="
-													material-icons
-													icon-with-button
-												"
+												class="material-icons icon-with-button"
 												>thumb_up_alt</i
 												>thumb_up_alt</i
 											>
 											>
 										</button>
 										</button>
 
 
 										<!-- Dislike Song Button -->
 										<!-- Dislike Song Button -->
 										<button
 										<button
-											class="
-												button
-												is-danger
-												dislike-song
-												disabled
-											"
+											class="button is-danger dislike-song disabled"
 											id="dislike-song"
 											id="dislike-song"
 											content="Ratings have not been loaded yet"
 											content="Ratings have not been loaded yet"
 											v-tippy
 											v-tippy
 										>
 										>
 											<i
 											<i
-												class="
-													material-icons
-													icon-with-button
-												"
+												class="material-icons icon-with-button"
 												>thumb_down_alt</i
 												>thumb_down_alt</i
 											>
 											>
 										</button>
 										</button>
@@ -557,15 +519,10 @@
 											>
 											>
 												<div class="control has-addons">
 												<div class="control has-addons">
 													<button
 													<button
-														class="
-															button
-															is-primary
-														"
+														class="button is-primary"
 													>
 													>
 														<i
 														<i
-															class="
-																material-icons
-															"
+															class="material-icons"
 														>
 														>
 															playlist_add
 															playlist_add
 														</i>
 														</i>
@@ -575,9 +532,7 @@
 														id="dropdown-toggle"
 														id="dropdown-toggle"
 													>
 													>
 														<i
 														<i
-															class="
-																material-icons
-															"
+															class="material-icons"
 														>
 														>
 															{{
 															{{
 																showPlaylistDropdown
 																showPlaylistDropdown
@@ -602,10 +557,7 @@
 											v-tippy="{ theme: 'info' }"
 											v-tippy="{ theme: 'info' }"
 										>
 										>
 											<i
 											<i
-												class="
-													material-icons
-													icon-with-button
-												"
+												class="material-icons icon-with-button"
 												>thumb_up_alt</i
 												>thumb_up_alt</i
 											>{{ currentSong.likes }}
 											>{{ currentSong.likes }}
 										</button>
 										</button>
@@ -618,10 +570,7 @@
 											v-tippy="{ theme: 'info' }"
 											v-tippy="{ theme: 'info' }"
 										>
 										>
 											<i
 											<i
-												class="
-													material-icons
-													icon-with-button
-												"
+												class="material-icons icon-with-button"
 												>thumb_down_alt</i
 												>thumb_down_alt</i
 											>{{ currentSong.dislikes }}
 											>{{ currentSong.dislikes }}
 										</button>
 										</button>
@@ -635,10 +584,7 @@
 											v-tippy="{ theme: 'info' }"
 											v-tippy="{ theme: 'info' }"
 										>
 										>
 											<i
 											<i
-												class="
-													material-icons
-													icon-with-button
-												"
+												class="material-icons icon-with-button"
 												>thumb_up_alt</i
 												>thumb_up_alt</i
 											>
 											>
 										</button>
 										</button>
@@ -651,10 +597,7 @@
 											v-tippy="{ theme: 'info' }"
 											v-tippy="{ theme: 'info' }"
 										>
 										>
 											<i
 											<i
-												class="
-													material-icons
-													icon-with-button
-												"
+												class="material-icons icon-with-button"
 												>thumb_down_alt</i
 												>thumb_down_alt</i
 											>
 											>
 										</button>
 										</button>
@@ -663,11 +606,7 @@
 									<div id="add-song-to-playlist">
 									<div id="add-song-to-playlist">
 										<div class="control has-addons">
 										<div class="control has-addons">
 											<button
 											<button
-												class="
-													button
-													is-primary
-													disabled
-												"
+												class="button is-primary disabled"
 												content="Log in to add songs to playlist"
 												content="Log in to add songs to playlist"
 												v-tippy="{ theme: 'info' }"
 												v-tippy="{ theme: 'info' }"
 											>
 											>

+ 3 - 3
frontend/src/store/modules/admin.js

@@ -30,12 +30,12 @@ const modules = {
 		actions: {
 		actions: {
 			/* eslint-disable-next-line no-unused-vars */
 			/* eslint-disable-next-line no-unused-vars */
 			resolveReport: ({ commit }, reportId) =>
 			resolveReport: ({ commit }, reportId) =>
-				new Promise((resolve, reject) =>
+				new Promise((resolve, reject) => {
 					admin.reports
 					admin.reports
 						.resolve(reportId)
 						.resolve(reportId)
 						.then(res => resolve(res))
 						.then(res => resolve(res))
-						.catch(err => reject(new Error(err.message)))
-				)
+						.catch(err => reject(new Error(err.message)));
+				})
 		},
 		},
 		mutations: {}
 		mutations: {}
 	},
 	},

+ 23 - 32
frontend/src/store/modules/user.js

@@ -33,60 +33,52 @@ const modules = {
 					const { username, email, password } = user;
 					const { username, email, password } = user;
 
 
 					if (!email || !username || !password)
 					if (!email || !username || !password)
-						return reject(new Error("Please fill in all fields"));
-
-					if (!validation.isLength(email, 3, 254))
-						return reject(
+						reject(new Error("Please fill in all fields"));
+					else if (!validation.isLength(email, 3, 254))
+						reject(
 							new Error(
 							new Error(
 								"Email must have between 3 and 254 characters."
 								"Email must have between 3 and 254 characters."
 							)
 							)
 						);
 						);
-
-					if (
+					else if (
 						email.indexOf("@") !== email.lastIndexOf("@") ||
 						email.indexOf("@") !== email.lastIndexOf("@") ||
 						!validation.regex.emailSimple.test(email)
 						!validation.regex.emailSimple.test(email)
 					)
 					)
-						return reject(new Error("Invalid email format."));
-
-					if (!validation.isLength(username, 2, 32))
-						return reject(
+						reject(new Error("Invalid email format."));
+					else if (!validation.isLength(username, 2, 32))
+						reject(
 							new Error(
 							new Error(
 								"Username must have between 2 and 32 characters."
 								"Username must have between 2 and 32 characters."
 							)
 							)
 						);
 						);
-
-					if (!validation.regex.azAZ09_.test(username))
-						return reject(
+					else if (!validation.regex.azAZ09_.test(username))
+						reject(
 							new Error(
 							new Error(
 								"Invalid username format. Allowed characters: a-z, A-Z, 0-9 and _."
 								"Invalid username format. Allowed characters: a-z, A-Z, 0-9 and _."
 							)
 							)
 						);
 						);
-
-					if (username.replaceAll(/[_]/g, "").length === 0)
-						return reject(
+					else if (username.replaceAll(/[_]/g, "").length === 0)
+						reject(
 							new Error(
 							new Error(
 								"Invalid username format. Allowed characters: a-z, A-Z, 0-9 and _, and there has to be at least one letter or number."
 								"Invalid username format. Allowed characters: a-z, A-Z, 0-9 and _, and there has to be at least one letter or number."
 							)
 							)
 						);
 						);
-
-					if (!validation.isLength(password, 6, 200))
-						return reject(
+					else if (!validation.isLength(password, 6, 200))
+						reject(
 							new Error(
 							new Error(
 								"Password must have between 6 and 200 characters."
 								"Password must have between 6 and 200 characters."
 							)
 							)
 						);
 						);
-
-					if (!validation.regex.password.test(password))
-						return reject(
+					else if (!validation.regex.password.test(password))
+						reject(
 							new Error(
 							new Error(
 								"Invalid password format. Must have one lowercase letter, one uppercase letter, one number and one special character."
 								"Invalid password format. Must have one lowercase letter, one uppercase letter, one number and one special character."
 							)
 							)
 						);
 						);
-
-					return auth
-						.register(user)
-						.then(res => resolve(res))
-						.catch(err => reject(new Error(err.message)));
+					else
+						auth.register(user)
+							.then(res => resolve(res))
+							.catch(err => reject(new Error(err.message)));
 				}),
 				}),
 			/* eslint-disable-next-line no-unused-vars */
 			/* eslint-disable-next-line no-unused-vars */
 			login: ({ commit }, user) =>
 			login: ({ commit }, user) =>
@@ -108,12 +100,11 @@ const modules = {
 						.catch(err => reject(new Error(err.message)));
 						.catch(err => reject(new Error(err.message)));
 				}),
 				}),
 			logout: () =>
 			logout: () =>
-				new Promise((resolve, reject) =>
-					auth
-						.logout()
+				new Promise((resolve, reject) => {
+					auth.logout()
 						.then(() => resolve())
 						.then(() => resolve())
-						.catch(() => reject())
-				),
+						.catch(() => reject());
+				}),
 			getUsernameFromId: ({ commit, state }, userId) =>
 			getUsernameFromId: ({ commit, state }, userId) =>
 				new Promise(resolve => {
 				new Promise(resolve => {
 					if (typeof state.userIdMap[`Z${userId}`] !== "string") {
 					if (typeof state.userIdMap[`Z${userId}`] !== "string") {