Browse Source

chore(linting): fixed linting errors created with airbnb
errors still exist and some solutions are temporary

Signed-off-by: Jonathan <theflametrooper@gmail.com>

Jonathan 5 years ago
parent
commit
d76d8db6b8
53 changed files with 900 additions and 732 deletions
  1. 7 1
      frontend/.eslintrc
  2. 11 11
      frontend/App.vue
  3. 19 18
      frontend/api/auth.js
  4. 7 7
      frontend/auth.js
  5. 108 66
      frontend/components/Admin/EditStation.vue
  6. 22 20
      frontend/components/Admin/News.vue
  7. 9 9
      frontend/components/Admin/Punishments.vue
  8. 18 16
      frontend/components/Admin/QueueSongs.vue
  9. 6 6
      frontend/components/Admin/Reports.vue
  10. 13 13
      frontend/components/Admin/Songs.vue
  11. 26 22
      frontend/components/Admin/Stations.vue
  12. 6 6
      frontend/components/Admin/Statistics.vue
  13. 5 5
      frontend/components/Admin/Users.vue
  14. 1 1
      frontend/components/MainFooter.vue
  15. 9 3
      frontend/components/MainHeader.vue
  16. 13 12
      frontend/components/Modals/AddSongToPlaylist.vue
  17. 19 20
      frontend/components/Modals/AddSongToQueue.vue
  18. 15 12
      frontend/components/Modals/CreateCommunityStation.vue
  19. 4 3
      frontend/components/Modals/EditNews.vue
  20. 89 61
      frontend/components/Modals/EditSong.vue
  21. 89 59
      frontend/components/Modals/EditStation.vue
  22. 18 15
      frontend/components/Modals/EditUser.vue
  23. 1 1
      frontend/components/Modals/IssuesModal.vue
  24. 5 5
      frontend/components/Modals/Login.vue
  25. 4 4
      frontend/components/Modals/MobileAlert.vue
  26. 1 1
      frontend/components/Modals/Modal.vue
  27. 5 5
      frontend/components/Modals/Playlists/Create.vue
  28. 49 50
      frontend/components/Modals/Playlists/Edit.vue
  29. 6 6
      frontend/components/Modals/Register.vue
  30. 12 12
      frontend/components/Modals/Report.vue
  31. 6 3
      frontend/components/Modals/ViewPunishment.vue
  32. 6 8
      frontend/components/Modals/WhatIsNew.vue
  33. 9 9
      frontend/components/Sidebars/Playlist.vue
  34. 7 7
      frontend/components/Sidebars/SongsList.vue
  35. 10 4
      frontend/components/Station/CommunityHeader.vue
  36. 10 4
      frontend/components/Station/OfficialHeader.vue
  37. 109 101
      frontend/components/Station/Station.vue
  38. 16 12
      frontend/components/User/ResetPassword.vue
  39. 32 28
      frontend/components/User/Settings.vue
  40. 5 5
      frontend/components/User/Show.vue
  41. 2 2
      frontend/components/UserIdToUsername.vue
  42. 1 1
      frontend/components/pages/About.vue
  43. 2 2
      frontend/components/pages/Admin.vue
  44. 45 42
      frontend/components/pages/Home.vue
  45. 3 3
      frontend/components/pages/News.vue
  46. 23 25
      frontend/io.js
  47. 3 2
      frontend/main.js
  48. 2 0
      frontend/store/modules/admin.js
  49. 2 0
      frontend/store/modules/modals.js
  50. 2 0
      frontend/store/modules/station.js
  51. 6 2
      frontend/store/modules/user.js
  52. 1 1
      frontend/webpack.common.js
  53. 1 1
      frontend/webpack.dev.js

+ 7 - 1
frontend/.eslintrc

@@ -27,6 +27,12 @@
 	"rules": {
 	"rules": {
 		"no-console": 0,
 		"no-console": 0,
 		"no-control-regex": 0,
 		"no-control-regex": 0,
-		"no-var": 2
+		"no-var": 2,
+		"no-underscore-dangle": 1,
+		"prefer-promise-reject-errors": 0, // temp
+		"no-nested-ternary": 0, // temp
+		"radix": 0,
+		"no-multi-assign": 0,
+		"no-shadow": 0
 	}
 	}
 }
 }

+ 11 - 11
frontend/App.vue

@@ -48,24 +48,24 @@ export default {
 		currentlyActive: state => state.modals.currentlyActive
 		currentlyActive: state => state.modals.currentlyActive
 	}),
 	}),
 	methods: {
 	methods: {
-		logout: function() {
-			let _this = this;
+		logout() {
+			const _this = this;
 			_this.socket.emit("users.logout", result => {
 			_this.socket.emit("users.logout", result => {
 				if (result.status === "success") {
 				if (result.status === "success") {
 					document.cookie =
 					document.cookie =
 						"SID=;expires=Thu, 01 Jan 1970 00:00:01 GMT;";
 						"SID=;expires=Thu, 01 Jan 1970 00:00:01 GMT;";
-					location.reload();
+					window.location.reload();
 				} else Toast.methods.addToast(result.message, 4000);
 				} else Toast.methods.addToast(result.message, 4000);
 			});
 			});
 		},
 		},
 		submitOnEnter: (cb, event) => {
 		submitOnEnter: (cb, event) => {
-			if (event.which == 13) cb();
+			if (event.which === 13) cb();
 		},
 		},
 		...mapActions("modals", ["closeCurrentModal"])
 		...mapActions("modals", ["closeCurrentModal"])
 	},
 	},
-	mounted: function() {
-		document.onkeydown = event => {
-			event = event || window.event;
+	mounted() {
+		document.onkeydown = ev => {
+			const event = ev || window.event;
 			if (
 			if (
 				event.keyCode === 27 &&
 				event.keyCode === 27 &&
 				Object.keys(this.currentlyActive).length !== 0
 				Object.keys(this.currentlyActive).length !== 0
@@ -73,7 +73,7 @@ export default {
 				this.closeCurrentModal();
 				this.closeCurrentModal();
 		};
 		};
 
 
-		let _this = this;
+		const _this = this;
 		if (localStorage.getItem("github_redirect")) {
 		if (localStorage.getItem("github_redirect")) {
 			this.$router.go(localStorage.getItem("github_redirect"));
 			this.$router.go(localStorage.getItem("github_redirect"));
 			localStorage.removeItem("github_redirect");
 			localStorage.removeItem("github_redirect");
@@ -103,7 +103,7 @@ export default {
 		});
 		});
 		_this.$router.onReady(() => {
 		_this.$router.onReady(() => {
 			if (_this.$route.query.err) {
 			if (_this.$route.query.err) {
-				let err = _this.$route.query.err;
+				let { err } = _this.$route.query;
 				err = err
 				err = err
 					.replace(new RegExp("<", "g"), "&lt;")
 					.replace(new RegExp("<", "g"), "&lt;")
 					.replace(new RegExp(">", "g"), "&gt;");
 					.replace(new RegExp(">", "g"), "&gt;");
@@ -111,7 +111,7 @@ export default {
 				Toast.methods.addToast(err, 20000);
 				Toast.methods.addToast(err, 20000);
 			}
 			}
 			if (_this.$route.query.msg) {
 			if (_this.$route.query.msg) {
-				let msg = _this.$route.query.msg;
+				let { msg } = _this.$route.query;
 				msg = msg
 				msg = msg
 					.replace(new RegExp("<", "g"), "&lt;")
 					.replace(new RegExp("<", "g"), "&lt;")
 					.replace(new RegExp(">", "g"), "&gt;");
 					.replace(new RegExp(">", "g"), "&gt;");
@@ -121,7 +121,7 @@ export default {
 		});
 		});
 		io.getSocket(true, socket => {
 		io.getSocket(true, socket => {
 			socket.on("keep.event:user.session.removed", () => {
 			socket.on("keep.event:user.session.removed", () => {
-				location.reload();
+				window.location.reload();
 			});
 			});
 		});
 		});
 	},
 	},

+ 19 - 18
frontend/api/auth.js

@@ -17,13 +17,13 @@ export default {
 					res => {
 					res => {
 						if (res.status === "success") {
 						if (res.status === "success") {
 							if (res.SID) {
 							if (res.SID) {
-								lofig.get("cookie", cookie => {
-									let date = new Date();
+								return lofig.get("cookie", cookie => {
+									const date = new Date();
 									date.setTime(
 									date.setTime(
 										new Date().getTime() +
 										new Date().getTime() +
 											2 * 365 * 24 * 60 * 60 * 1000
 											2 * 365 * 24 * 60 * 60 * 1000
 									);
 									);
-									let secure = cookie.secure
+									const secure = cookie.secure
 										? "secure=true; "
 										? "secure=true; "
 										: "";
 										: "";
 									document.cookie = `SID=${
 									document.cookie = `SID=${
@@ -31,18 +31,19 @@ export default {
 									}; expires=${date.toGMTString()}; domain=${
 									}; expires=${date.toGMTString()}; domain=${
 										cookie.domain
 										cookie.domain
 									}; ${secure}path=/`;
 									}; ${secure}path=/`;
+
 									return resolve({ status: "success" });
 									return resolve({ status: "success" });
 								});
 								});
-							} else
-								return reject({
-									status: "error",
-									message: "You must login"
-								});
-						} else
+							}
 							return reject({
 							return reject({
 								status: "error",
 								status: "error",
-								message: res.message
+								message: "You must login"
 							});
 							});
+						}
+						return reject({
+							status: "error",
+							message: res.message
+						});
 					}
 					}
 				);
 				);
 			});
 			});
@@ -55,13 +56,13 @@ export default {
 			io.getSocket(socket => {
 			io.getSocket(socket => {
 				socket.emit("users.login", email, password, res => {
 				socket.emit("users.login", email, password, res => {
 					if (res.status === "success") {
 					if (res.status === "success") {
-						lofig.get("cookie", cookie => {
-							let date = new Date();
+						return lofig.get("cookie", cookie => {
+							const date = new Date();
 							date.setTime(
 							date.setTime(
 								new Date().getTime() +
 								new Date().getTime() +
 									2 * 365 * 24 * 60 * 60 * 1000
 									2 * 365 * 24 * 60 * 60 * 1000
 							);
 							);
-							let secure = cookie.secure ? "secure=true; " : "";
+							const secure = cookie.secure ? "secure=true; " : "";
 							let domain = "";
 							let domain = "";
 							if (cookie.domain !== "localhost")
 							if (cookie.domain !== "localhost")
 								domain = ` domain=${cookie.domain};`;
 								domain = ` domain=${cookie.domain};`;
@@ -70,11 +71,11 @@ export default {
 							}; expires=${date.toGMTString()}; ${domain}${secure}path=/`;
 							}; expires=${date.toGMTString()}; ${domain}${secure}path=/`;
 							return resolve({ status: "success" });
 							return resolve({ status: "success" });
 						});
 						});
-					} else
-						return reject({
-							status: "error",
-							message: res.message
-						});
+					}
+					return reject({
+						status: "error",
+						message: res.message
+					});
 				});
 				});
 			});
 			});
 		});
 		});

+ 7 - 7
frontend/auth.js

@@ -1,5 +1,5 @@
 let callbacks = [];
 let callbacks = [];
-let bannedCallbacks = [];
+const bannedCallbacks = [];
 
 
 export default {
 export default {
 	ready: false,
 	ready: false,
@@ -10,14 +10,14 @@ export default {
 	banned: null,
 	banned: null,
 	ban: {},
 	ban: {},
 
 
-	getStatus: function(cb) {
+	getStatus(cb) {
 		if (this.ready)
 		if (this.ready)
 			cb(this.authenticated, this.role, this.username, this.userId);
 			cb(this.authenticated, this.role, this.username, this.userId);
 		else callbacks.push(cb);
 		else callbacks.push(cb);
 	},
 	},
 
 
-	setBanned: function(ban) {
-		let _this = this;
+	setBanned(ban) {
+		const _this = this;
 		_this.banned = true;
 		_this.banned = true;
 		_this.ban = ban;
 		_this.ban = ban;
 		bannedCallbacks.forEach(callback => {
 		bannedCallbacks.forEach(callback => {
@@ -25,13 +25,13 @@ export default {
 		});
 		});
 	},
 	},
 
 
-	isBanned: function(cb) {
+	isBanned(cb) {
 		if (this.ready) return cb(false);
 		if (this.ready) return cb(false);
 		if (!this.ready && this.banned === true) return cb(true, this.ban);
 		if (!this.ready && this.banned === true) return cb(true, this.ban);
-		bannedCallbacks.push(cb);
+		return bannedCallbacks.push(cb);
 	},
 	},
 
 
-	data: function(authenticated, role, username, userId) {
+	data(authenticated, role, username, userId) {
 		this.authenticated = authenticated;
 		this.authenticated = authenticated;
 		this.role = role;
 		this.role = role;
 		this.username = username;
 		this.username = username;

+ 108 - 66
frontend/components/Admin/EditStation.vue

@@ -162,12 +162,15 @@ export default {
 		station: state => state.station,
 		station: state => state.station,
 		editing: state => state.editing
 		editing: state => state.editing
 	}),
 	}),
-	mounted: function() {
-		let _this = this;
-		io.getSocket(socket => (_this.socket = socket));
+	mounted() {
+		const _this = this;
+		io.getSocket(socket => {
+			_this.socket = socket;
+			return socket;
+		});
 	},
 	},
 	methods: {
 	methods: {
-		update: function() {
+		update() {
 			if (this.station.name !== this.editing.name) this.updateName();
 			if (this.station.name !== this.editing.name) this.updateName();
 			if (this.station.displayName !== this.editing.displayName)
 			if (this.station.displayName !== this.editing.displayName)
 				this.updateDisplayName();
 				this.updateDisplayName();
@@ -188,8 +191,8 @@ export default {
 			)
 			)
 				this.updateBlacklistedGenres();
 				this.updateBlacklistedGenres();
 		},
 		},
-		updateName: function() {
-			const name = this.editing.name;
+		updateName() {
+			const { name } = this.editing;
 			if (!validation.isLength(name, 2, 16))
 			if (!validation.isLength(name, 2, 16))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Name must have between 2 and 16 characters.",
 					"Name must have between 2 and 16 characters.",
@@ -201,7 +204,7 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateName",
 				"stations.updateName",
 				this.editing._id,
 				this.editing._id,
 				name,
 				name,
@@ -209,18 +212,20 @@ export default {
 					if (res.status === "success") {
 					if (res.status === "success") {
 						if (this.station) this.station.name = name;
 						if (this.station) this.station.name = name;
 						this.$parent.stations.forEach((station, index) => {
 						this.$parent.stations.forEach((station, index) => {
-							if (station._id === this.editing._id)
-								return (this.$parent.stations[
-									index
-								].name = name);
+							if (station._id === this.editing._id) {
+								this.$parent.stations[index].name = name;
+								return name;
+							}
+
+							return false;
 						});
 						});
 					}
 					}
 					Toast.methods.addToast(res.message, 8000);
 					Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		updateDisplayName: function() {
-			const displayName = this.editing.displayName;
+		updateDisplayName() {
+			const { displayName } = this.editing;
 			if (!validation.isLength(displayName, 2, 32))
 			if (!validation.isLength(displayName, 2, 32))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Display name must have between 2 and 32 characters.",
 					"Display name must have between 2 and 32 characters.",
@@ -232,29 +237,36 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateDisplayName",
 				"stations.updateDisplayName",
 				this.editing._id,
 				this.editing._id,
 				displayName,
 				displayName,
 				res => {
 				res => {
 					if (res.status === "success") {
 					if (res.status === "success") {
-						if (this.station)
+						if (this.station) {
 							this.station.displayName = displayName;
 							this.station.displayName = displayName;
+							return displayName;
+						}
 						this.$parent.stations.forEach((station, index) => {
 						this.$parent.stations.forEach((station, index) => {
-							if (station._id === this.editing._id)
-								return (this.$parent.stations[
+							if (station._id === this.editing._id) {
+								this.$parent.stations[
 									index
 									index
-								].displayName = displayName);
+								].displayName = displayName;
+								return displayName;
+							}
+
+							return false;
 						});
 						});
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		updateDescription: function() {
-			let _this = this;
+		updateDescription() {
+			const _this = this;
 
 
-			const description = this.editing.description;
+			const { description } = this.editing;
 			if (!validation.isLength(description, 2, 200))
 			if (!validation.isLength(description, 2, 200))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Description must have between 2 and 200 characters.",
 					"Description must have between 2 and 200 characters.",
@@ -270,28 +282,36 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateDescription",
 				"stations.updateDescription",
 				this.editing._id,
 				this.editing._id,
 				description,
 				description,
 				res => {
 				res => {
 					if (res.status === "success") {
 					if (res.status === "success") {
-						if (_this.station)
+						if (_this.station) {
 							_this.station.description = description;
 							_this.station.description = description;
+							return description;
+						}
 						_this.$parent.stations.forEach((station, index) => {
 						_this.$parent.stations.forEach((station, index) => {
-							if (station._id === station._id)
-								return (_this.$parent.stations[
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[
 									index
 									index
-								].description = description);
+								].description = description;
+								return description;
+							}
+
+							return false;
 						});
 						});
+
 						return Toast.methods.addToast(res.message, 4000);
 						return Toast.methods.addToast(res.message, 4000);
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		updatePrivacy: function() {
-			let _this = this;
+		updatePrivacy() {
+			const _this = this;
 			this.socket.emit(
 			this.socket.emit(
 				"stations.updatePrivacy",
 				"stations.updatePrivacy",
 				this.editing._id,
 				this.editing._id,
@@ -302,69 +322,81 @@ export default {
 							_this.station.privacy = _this.editing.privacy;
 							_this.station.privacy = _this.editing.privacy;
 						else {
 						else {
 							_this.$parent.stations.forEach((station, index) => {
 							_this.$parent.stations.forEach((station, index) => {
-								if (station._id === station._id)
-									return (_this.$parent.stations[
-										index
-									].privacy = _this.editing.privacy);
+								if (station._id === _this.editing._id) {
+									_this.$parent.stations[index].privacy =
+										_this.editing.privacy;
+									return _this.editing.privacy;
+								}
+
+								return false;
 							});
 							});
 						}
 						}
 						return Toast.methods.addToast(res.message, 4000);
 						return Toast.methods.addToast(res.message, 4000);
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		updateGenres: function() {
-			let _this = this;
+		updateGenres() {
+			const _this = this;
 			this.socket.emit(
 			this.socket.emit(
 				"stations.updateGenres",
 				"stations.updateGenres",
 				this.editing._id,
 				this.editing._id,
 				this.editing.genres,
 				this.editing.genres,
 				res => {
 				res => {
 					if (res.status === "success") {
 					if (res.status === "success") {
-						let genres = JSON.parse(
+						const genres = JSON.parse(
 							JSON.stringify(_this.editing.genres)
 							JSON.stringify(_this.editing.genres)
 						);
 						);
 						if (_this.station) _this.station.genres = genres;
 						if (_this.station) _this.station.genres = genres;
 						_this.$parent.stations.forEach((station, index) => {
 						_this.$parent.stations.forEach((station, index) => {
-							if (station._id === station._id)
-								return (_this.$parent.stations[
-									index
-								].genres = genres);
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[index].genres = genres;
+								return genres;
+							}
+
+							return false;
 						});
 						});
 						return Toast.methods.addToast(res.message, 4000);
 						return Toast.methods.addToast(res.message, 4000);
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		updateBlacklistedGenres: function() {
-			let _this = this;
+		updateBlacklistedGenres() {
+			const _this = this;
 			this.socket.emit(
 			this.socket.emit(
 				"stations.updateBlacklistedGenres",
 				"stations.updateBlacklistedGenres",
 				this.editing._id,
 				this.editing._id,
 				this.editing.blacklistedGenres,
 				this.editing.blacklistedGenres,
 				res => {
 				res => {
 					if (res.status === "success") {
 					if (res.status === "success") {
-						let blacklistedGenres = JSON.parse(
+						const blacklistedGenres = JSON.parse(
 							JSON.stringify(_this.editing.blacklistedGenres)
 							JSON.stringify(_this.editing.blacklistedGenres)
 						);
 						);
 						if (_this.station)
 						if (_this.station)
 							_this.station.blacklistedGenres = blacklistedGenres;
 							_this.station.blacklistedGenres = blacklistedGenres;
 						_this.$parent.stations.forEach((station, index) => {
 						_this.$parent.stations.forEach((station, index) => {
-							if (station._id === station._id)
-								return (_this.$parent.stations[
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[
 									index
 									index
-								].blacklistedGenres = blacklistedGenres);
+								].blacklistedGenres = blacklistedGenres;
+								return blacklistedGenres;
+							}
+
+							return false;
 						});
 						});
 						return Toast.methods.addToast(res.message, 4000);
 						return Toast.methods.addToast(res.message, 4000);
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		updatePartyMode: function() {
-			let _this = this;
+		updatePartyMode() {
+			const _this = this;
 			this.socket.emit(
 			this.socket.emit(
 				"stations.updatePartyMode",
 				"stations.updatePartyMode",
 				this.editing._id,
 				this.editing._id,
@@ -374,34 +406,42 @@ export default {
 						if (_this.station)
 						if (_this.station)
 							_this.station.partyMode = _this.editing.partyMode;
 							_this.station.partyMode = _this.editing.partyMode;
 						_this.$parent.stations.forEach((station, index) => {
 						_this.$parent.stations.forEach((station, index) => {
-							if (station._id === station._id)
-								return (_this.$parent.stations[
-									index
-								].partyMode = _this.editing.partyMode);
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[index].partyMode =
+									_this.editing.partyMode;
+								return _this.editing.partyMode;
+							}
+
+							return false;
 						});
 						});
+
 						return Toast.methods.addToast(res.message, 4000);
 						return Toast.methods.addToast(res.message, 4000);
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		addGenre: function() {
-			let genre = document
+		addGenre() {
+			const genre = document
 				.getElementById(`new-genre-edit`)
 				.getElementById(`new-genre-edit`)
 				.value.toLowerCase()
 				.value.toLowerCase()
 				.trim();
 				.trim();
+
 			if (this.editing.genres.indexOf(genre) !== -1)
 			if (this.editing.genres.indexOf(genre) !== -1)
 				return Toast.methods.addToast("Genre already exists", 3000);
 				return Toast.methods.addToast("Genre already exists", 3000);
 			if (genre) {
 			if (genre) {
 				this.editing.genres.push(genre);
 				this.editing.genres.push(genre);
 				document.getElementById(`new-genre`).value = "";
 				document.getElementById(`new-genre`).value = "";
-			} else Toast.methods.addToast("Genre cannot be empty", 3000);
+				return true;
+			}
+			return Toast.methods.addToast("Genre cannot be empty", 3000);
 		},
 		},
-		removeGenre: function(index) {
+		removeGenre(index) {
 			this.editing.genres.splice(index, 1);
 			this.editing.genres.splice(index, 1);
 		},
 		},
-		addBlacklistedGenre: function() {
-			let genre = document
+		addBlacklistedGenre() {
+			const genre = document
 				.getElementById(`new-blacklisted-genre-edit`)
 				.getElementById(`new-blacklisted-genre-edit`)
 				.value.toLowerCase()
 				.value.toLowerCase()
 				.trim();
 				.trim();
@@ -411,12 +451,14 @@ export default {
 			if (genre) {
 			if (genre) {
 				this.editing.blacklistedGenres.push(genre);
 				this.editing.blacklistedGenres.push(genre);
 				document.getElementById(`new-blacklisted-genre`).value = "";
 				document.getElementById(`new-blacklisted-genre`).value = "";
-			} else Toast.methods.addToast("Genre cannot be empty", 3000);
+				return true;
+			}
+			return Toast.methods.addToast("Genre cannot be empty", 3000);
 		},
 		},
-		removeBlacklistedGenre: function(index) {
+		removeBlacklistedGenre(index) {
 			this.editing.blacklistedGenres.splice(index, 1);
 			this.editing.blacklistedGenres.splice(index, 1);
 		},
 		},
-		deleteStation: function() {
+		deleteStation() {
 			this.socket.emit("stations.remove", this.editing._id, res => {
 			this.socket.emit("stations.remove", this.editing._id, res => {
 				Toast.methods.addToast(res.message, 8000);
 				Toast.methods.addToast(res.message, 8000);
 			});
 			});

+ 22 - 20
frontend/components/Admin/News.vue

@@ -235,14 +235,14 @@ export default {
 			editing: {}
 			editing: {}
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
-			_this.socket.emit(
-				"news.index",
-				result => (_this.news = result.data)
-			);
+			_this.socket.emit("news.index", res => {
+				_this.news = res.data;
+				return res.data;
+			});
 			_this.socket.on("event:admin.news.created", news => {
 			_this.socket.on("event:admin.news.created", news => {
 				_this.news.unshift(news);
 				_this.news.unshift(news);
 			});
 			});
@@ -259,10 +259,10 @@ export default {
 		})
 		})
 	},
 	},
 	methods: {
 	methods: {
-		createNews: function() {
-			let _this = this;
+		createNews() {
+			const _this = this;
 
 
-			let {
+			const {
 				creating: { bugs, features, improvements, upcoming }
 				creating: { bugs, features, improvements, upcoming }
 			} = this;
 			} = this;
 
 
@@ -287,9 +287,9 @@ export default {
 					3000
 					3000
 				);
 				);
 
 
-			_this.socket.emit("news.create", _this.creating, result => {
+			return _this.socket.emit("news.create", _this.creating, result => {
 				Toast.methods.addToast(result.message, 4000);
 				Toast.methods.addToast(result.message, 4000);
-				if (result.status == "success")
+				if (result.status === "success")
 					_this.creating = {
 					_this.creating = {
 						title: "",
 						title: "",
 						description: "",
 						description: "",
@@ -300,17 +300,17 @@ export default {
 					};
 					};
 			});
 			});
 		},
 		},
-		removeNews: function(news) {
+		removeNews(news) {
 			this.socket.emit("news.remove", news, res =>
 			this.socket.emit("news.remove", news, res =>
 				Toast.methods.addToast(res.message, 8000)
 				Toast.methods.addToast(res.message, 8000)
 			);
 			);
 		},
 		},
-		editNews: function(news) {
+		editNews(news) {
 			this.editing = news;
 			this.editing = news;
 			this.openModal({ sector: "admin", modal: "editNews" });
 			this.openModal({ sector: "admin", modal: "editNews" });
 		},
 		},
-		updateNews: function(close) {
-			let _this = this;
+		updateNews(close) {
+			const _this = this;
 			this.socket.emit(
 			this.socket.emit(
 				"news.update",
 				"news.update",
 				_this.editing._id,
 				_this.editing._id,
@@ -327,8 +327,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		addChange: function(type) {
-			let change = document.getElementById(`new-${type}`).value.trim();
+		addChange(type) {
+			const change = document.getElementById(`new-${type}`).value.trim();
 
 
 			if (this.creating[type].indexOf(change) !== -1)
 			if (this.creating[type].indexOf(change) !== -1)
 				return Toast.methods.addToast(`Tag already exists`, 3000);
 				return Toast.methods.addToast(`Tag already exists`, 3000);
@@ -336,12 +336,14 @@ export default {
 			if (change) {
 			if (change) {
 				document.getElementById(`new-${type}`).value = "";
 				document.getElementById(`new-${type}`).value = "";
 				this.creating[type].push(change);
 				this.creating[type].push(change);
-			} else Toast.methods.addToast(`${type} cannot be empty`, 3000);
+				return true;
+			}
+			return Toast.methods.addToast(`${type} cannot be empty`, 3000);
 		},
 		},
-		removeChange: function(type, index) {
+		removeChange(type, index) {
 			this.creating[type].splice(index, 1);
 			this.creating[type].splice(index, 1);
 		},
 		},
-		init: function() {
+		init() {
 			this.socket.emit("apis.joinAdminRoom", "news", () => {});
 			this.socket.emit("apis.joinAdminRoom", "news", () => {});
 		},
 		},
 		...mapActions("modals", ["openModal", "closeModal"])
 		...mapActions("modals", ["openModal", "closeModal"])

+ 9 - 9
frontend/components/Admin/Punishments.vue

@@ -128,7 +128,7 @@ export default {
 		};
 		};
 	},
 	},
 	computed: {
 	computed: {
-		sortedPunishments: function() {
+		sortedPunishments() {
 			//   return _.orderBy(this.punishments, -1);
 			//   return _.orderBy(this.punishments, -1);
 			return this.punishments;
 			return this.punishments;
 		},
 		},
@@ -137,12 +137,12 @@ export default {
 		})
 		})
 	},
 	},
 	methods: {
 	methods: {
-		view: function(punishment) {
+		view(punishment) {
 			this.viewPunishment(punishment);
 			this.viewPunishment(punishment);
 			this.openModal({ sector: "admin", modal: "viewPunishment" });
 			this.openModal({ sector: "admin", modal: "viewPunishment" });
 		},
 		},
-		banIP: function() {
-			let _this = this;
+		banIP() {
+			const _this = this;
 			_this.socket.emit(
 			_this.socket.emit(
 				"punishments.banIP",
 				"punishments.banIP",
 				_this.ipBan.ip,
 				_this.ipBan.ip,
@@ -153,18 +153,18 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.socket.emit("punishments.index", res => {
 			_this.socket.emit("punishments.index", res => {
 				if (res.status === "success") _this.punishments = res.data;
 				if (res.status === "success") _this.punishments = res.data;
 			});
 			});
-			//_this.socket.emit('apis.joinAdminRoom', 'punishments', () => {});
+			// _this.socket.emit('apis.joinAdminRoom', 'punishments', () => {});
 		},
 		},
 		...mapActions("modals", ["openModal"]),
 		...mapActions("modals", ["openModal"]),
 		...mapActions("admin/punishments", ["viewPunishment"])
 		...mapActions("admin/punishments", ["viewPunishment"])
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			if (_this.socket.connected) _this.init();
 			if (_this.socket.connected) _this.init();

+ 18 - 16
frontend/components/Admin/QueueSongs.vue

@@ -121,7 +121,7 @@ export default {
 		};
 		};
 	},
 	},
 	computed: {
 	computed: {
-		filteredSongs: function() {
+		filteredSongs() {
 			return this.songs;
 			return this.songs;
 			// return this.songs.filter(song => song.indexOf(song.searchQuery) !== -1);
 			// return this.songs.filter(song => song.indexOf(song.searchQuery) !== -1);
 		},
 		},
@@ -136,36 +136,38 @@ export default {
 	//   }
 	//   }
 	// },
 	// },
 	methods: {
 	methods: {
-		getSet: function(position) {
-			let _this = this;
+		getSet(position) {
+			const _this = this;
 			this.socket.emit("queueSongs.getSet", position, data => {
 			this.socket.emit("queueSongs.getSet", position, data => {
 				_this.songs = data;
 				_this.songs = data;
 				this.position = position;
 				this.position = position;
 			});
 			});
 		},
 		},
-		edit: function(song, index) {
-			let newSong = {};
-			for (let n in song) newSong[n] = song[n];
+		edit(song, index) {
+			const newSong = {};
+			Object.keys(song).forEach(n => {
+				newSong[n] = song[n];
+			});
 
 
 			this.editSong({ index, song: newSong, type: "queueSongs" });
 			this.editSong({ index, song: newSong, type: "queueSongs" });
 			this.openModal({ sector: "admin", modal: "editSong" });
 			this.openModal({ sector: "admin", modal: "editSong" });
 		},
 		},
-		add: function(song) {
+		add(song) {
 			this.socket.emit("songs.add", song, res => {
 			this.socket.emit("songs.add", song, res => {
-				if (res.status == "success")
+				if (res.status === "success")
 					Toast.methods.addToast(res.message, 2000);
 					Toast.methods.addToast(res.message, 2000);
 				else Toast.methods.addToast(res.message, 4000);
 				else Toast.methods.addToast(res.message, 4000);
 			});
 			});
 		},
 		},
-		remove: function(id) {
+		remove(id) {
 			this.socket.emit("queueSongs.remove", id, res => {
 			this.socket.emit("queueSongs.remove", id, res => {
-				if (res.status == "success")
+				if (res.status === "success")
 					Toast.methods.addToast(res.message, 2000);
 					Toast.methods.addToast(res.message, 2000);
 				else Toast.methods.addToast(res.message, 4000);
 				else Toast.methods.addToast(res.message, 4000);
 			});
 			});
 		},
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.socket.emit("queueSongs.index", data => {
 			_this.socket.emit("queueSongs.index", data => {
 				_this.songs = data.songs;
 				_this.songs = data.songs;
 				_this.maxPosition = Math.round(data.maxLength / 50);
 				_this.maxPosition = Math.round(data.maxLength / 50);
@@ -175,8 +177,8 @@ export default {
 		...mapActions("admin/songs", ["stopVideo", "editSong"]),
 		...mapActions("admin/songs", ["stopVideo", "editSong"]),
 		...mapActions("modals", ["openModal"])
 		...mapActions("modals", ["openModal"])
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			if (_this.socket.connected) {
 			if (_this.socket.connected) {
@@ -192,8 +194,8 @@ export default {
 				_this.socket.on(
 				_this.socket.on(
 					"event:admin.queueSong.updated",
 					"event:admin.queueSong.updated",
 					updatedSong => {
 					updatedSong => {
-						for (let i = 0; i < _this.songs.length; i++) {
-							let song = _this.songs[i];
+						for (let i = 0; i < _this.songs.length; i += 1) {
+							const song = _this.songs[i];
 							if (song._id === updatedSong._id) {
 							if (song._id === updatedSong._id) {
 								_this.songs.$set(i, updatedSong);
 								_this.songs.$set(i, updatedSong);
 							}
 							}

+ 6 - 6
frontend/components/Admin/Reports.vue

@@ -67,8 +67,8 @@ export default {
 			reports: []
 			reports: []
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			if (_this.socket.connected) _this.init();
 			if (_this.socket.connected) _this.init();
@@ -105,15 +105,15 @@ export default {
 		})
 		})
 	},
 	},
 	methods: {
 	methods: {
-		init: function() {
+		init() {
 			this.socket.emit("apis.joinAdminRoom", "reports", () => {});
 			this.socket.emit("apis.joinAdminRoom", "reports", () => {});
 		},
 		},
-		view: function(report) {
+		view(report) {
 			this.viewReport(report);
 			this.viewReport(report);
 			this.openModal({ sector: "admin", modal: "viewReport" });
 			this.openModal({ sector: "admin", modal: "viewReport" });
 		},
 		},
-		resolve: function(reportId) {
-			let _this = this;
+		resolve(reportId) {
+			const _this = this;
 			this.socket.emit("reports.resolve", reportId, res => {
 			this.socket.emit("reports.resolve", reportId, res => {
 				Toast.methods.addToast(res.message, 3000);
 				Toast.methods.addToast(res.message, 3000);
 				if (res.status === "success" && this.modals.viewReport)
 				if (res.status === "success" && this.modals.viewReport)

+ 13 - 13
frontend/components/Admin/Songs.vue

@@ -101,7 +101,7 @@ export default {
 		};
 		};
 	},
 	},
 	computed: {
 	computed: {
-		filteredSongs: function() {
+		filteredSongs() {
 			return this.songs;
 			return this.songs;
 			// return this.songs.filter(song => song.indexOf(song.searchQuery) !== -1);
 			// return this.songs.filter(song => song.indexOf(song.searchQuery) !== -1);
 		},
 		},
@@ -115,29 +115,29 @@ export default {
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
-		edit: function(song) {
+		edit(song) {
 			this.editSong({ song, type: "songs" });
 			this.editSong({ song, type: "songs" });
 			this.openModal({ sector: "admin", modal: "editSong" });
 			this.openModal({ sector: "admin", modal: "editSong" });
 		},
 		},
-		remove: function(id) {
+		remove(id) {
 			this.socket.emit("songs.remove", id, res => {
 			this.socket.emit("songs.remove", id, res => {
-				if (res.status == "success")
+				if (res.status === "success")
 					Toast.methods.addToast(res.message, 4000);
 					Toast.methods.addToast(res.message, 4000);
 				else Toast.methods.addToast(res.message, 8000);
 				else Toast.methods.addToast(res.message, 8000);
 			});
 			});
 		},
 		},
-		getSet: function() {
-			let _this = this;
+		getSet() {
+			const _this = this;
 			_this.socket.emit("songs.getSet", _this.position, data => {
 			_this.socket.emit("songs.getSet", _this.position, data => {
 				data.forEach(song => {
 				data.forEach(song => {
 					_this.songs.push(song);
 					_this.songs.push(song);
 				});
 				});
-				_this.position = _this.position + 1;
+				_this.position += 1;
 				if (_this.maxPosition > _this.position - 1) _this.getSet();
 				if (_this.maxPosition > _this.position - 1) _this.getSet();
 			});
 			});
 		},
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.songs = [];
 			_this.songs = [];
 			_this.socket.emit("songs.length", length => {
 			_this.socket.emit("songs.length", length => {
 				_this.maxPosition = Math.ceil(length / 15);
 				_this.maxPosition = Math.ceil(length / 15);
@@ -148,8 +148,8 @@ export default {
 		...mapActions("admin/songs", ["stopVideo", "editSong"]),
 		...mapActions("admin/songs", ["stopVideo", "editSong"]),
 		...mapActions("modals", ["openModal", "closeModal"])
 		...mapActions("modals", ["openModal", "closeModal"])
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			if (_this.socket.connected) {
 			if (_this.socket.connected) {
@@ -163,8 +163,8 @@ export default {
 					});
 					});
 				});
 				});
 				_this.socket.on("event:admin.song.updated", updatedSong => {
 				_this.socket.on("event:admin.song.updated", updatedSong => {
-					for (let i = 0; i < _this.songs.length; i++) {
-						let song = _this.songs[i];
+					for (let i = 0; i < _this.songs.length; i += 1) {
+						const song = _this.songs[i];
 						if (song._id === updatedSong._id) {
 						if (song._id === updatedSong._id) {
 							_this.songs.$set(i, updatedSong);
 							_this.songs.$set(i, updatedSong);
 						}
 						}

+ 26 - 22
frontend/components/Admin/Stations.vue

@@ -191,9 +191,9 @@ export default {
 		})
 		})
 	},
 	},
 	methods: {
 	methods: {
-		createStation: function() {
-			let _this = this;
-			let {
+		createStation() {
+			const _this = this;
+			const {
 				newStation: {
 				newStation: {
 					name,
 					name,
 					displayName,
 					displayName,
@@ -203,23 +203,23 @@ export default {
 				}
 				}
 			} = this;
 			} = this;
 
 
-			if (name == undefined)
+			if (name === undefined)
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Field (Name) cannot be empty",
 					"Field (Name) cannot be empty",
 					3000
 					3000
 				);
 				);
-			if (displayName == undefined)
+			if (displayName === undefined)
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Field (Display Name) cannot be empty",
 					"Field (Display Name) cannot be empty",
 					3000
 					3000
 				);
 				);
-			if (description == undefined)
+			if (description === undefined)
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Field (Description) cannot be empty",
 					"Field (Description) cannot be empty",
 					3000
 					3000
 				);
 				);
 
 
-			_this.socket.emit(
+			return _this.socket.emit(
 				"stations.create",
 				"stations.create",
 				{
 				{
 					name,
 					name,
@@ -231,7 +231,7 @@ export default {
 				},
 				},
 				result => {
 				result => {
 					Toast.methods.addToast(result.message, 3000);
 					Toast.methods.addToast(result.message, 3000);
-					if (result.status == "success")
+					if (result.status === "success")
 						this.newStation = {
 						this.newStation = {
 							genres: [],
 							genres: [],
 							blacklistedGenres: []
 							blacklistedGenres: []
@@ -239,7 +239,7 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		removeStation: function(index) {
+		removeStation(index) {
 			this.socket.emit(
 			this.socket.emit(
 				"stations.remove",
 				"stations.remove",
 				this.stations[index]._id,
 				this.stations[index]._id,
@@ -248,7 +248,7 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		edit: function(station) {
+		edit(station) {
 			this.editStation({
 			this.editStation({
 				_id: station._id,
 				_id: station._id,
 				name: station.name,
 				name: station.name,
@@ -265,8 +265,8 @@ export default {
 				modal: "editStation"
 				modal: "editStation"
 			});
 			});
 		},
 		},
-		addGenre: function() {
-			let genre = document
+		addGenre() {
+			const genre = document
 				.getElementById(`new-genre`)
 				.getElementById(`new-genre`)
 				.value.toLowerCase()
 				.value.toLowerCase()
 				.trim();
 				.trim();
@@ -275,13 +275,15 @@ export default {
 			if (genre) {
 			if (genre) {
 				this.newStation.genres.push(genre);
 				this.newStation.genres.push(genre);
 				document.getElementById(`new-genre`).value = "";
 				document.getElementById(`new-genre`).value = "";
-			} else Toast.methods.addToast("Genre cannot be empty", 3000);
+				return true;
+			}
+			return Toast.methods.addToast("Genre cannot be empty", 3000);
 		},
 		},
-		removeGenre: function(index) {
+		removeGenre(index) {
 			this.newStation.genres.splice(index, 1);
 			this.newStation.genres.splice(index, 1);
 		},
 		},
-		addBlacklistedGenre: function() {
-			let genre = document
+		addBlacklistedGenre() {
+			const genre = document
 				.getElementById(`new-blacklisted-genre`)
 				.getElementById(`new-blacklisted-genre`)
 				.value.toLowerCase()
 				.value.toLowerCase()
 				.trim();
 				.trim();
@@ -291,13 +293,15 @@ export default {
 			if (genre) {
 			if (genre) {
 				this.newStation.blacklistedGenres.push(genre);
 				this.newStation.blacklistedGenres.push(genre);
 				document.getElementById(`new-blacklisted-genre`).value = "";
 				document.getElementById(`new-blacklisted-genre`).value = "";
-			} else Toast.methods.addToast("Genre cannot be empty", 3000);
+				return true;
+			}
+			return Toast.methods.addToast("Genre cannot be empty", 3000);
 		},
 		},
-		removeBlacklistedGenre: function(index) {
+		removeBlacklistedGenre(index) {
 			this.newStation.blacklistedGenres.splice(index, 1);
 			this.newStation.blacklistedGenres.splice(index, 1);
 		},
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.socket.emit("stations.index", data => {
 			_this.socket.emit("stations.index", data => {
 				_this.stations = data.stations;
 				_this.stations = data.stations;
 			});
 			});
@@ -306,8 +310,8 @@ export default {
 		...mapActions("modals", ["openModal"]),
 		...mapActions("modals", ["openModal"]),
 		...mapActions("admin/stations", ["editStation"])
 		...mapActions("admin/stations", ["editStation"])
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			if (_this.socket.connected) _this.init();
 			if (_this.socket.connected) _this.init();

+ 6 - 6
frontend/components/Admin/Statistics.vue

@@ -143,10 +143,10 @@ export default {
 			}
 			}
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
-		let minuteCtx = document.getElementById("minuteChart");
-		let hourCtx = document.getElementById("hourChart");
+	mounted() {
+		const _this = this;
+		const minuteCtx = document.getElementById("minuteChart");
+		const hourCtx = document.getElementById("hourChart");
 
 
 		_this.minuteChart = new Chart(minuteCtx, {
 		_this.minuteChart = new Chart(minuteCtx, {
 			type: "line",
 			type: "line",
@@ -273,7 +273,7 @@ export default {
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		init: function() {
+		init() {
 			this.socket.emit("apis.joinAdminRoom", "statistics", () => {});
 			this.socket.emit("apis.joinAdminRoom", "statistics", () => {});
 			this.socket.on(
 			this.socket.on(
 				"event:admin.statistics.success.units.minute",
 				"event:admin.statistics.success.units.minute",
@@ -321,7 +321,7 @@ export default {
 				this.logs = logs;
 				this.logs = logs;
 			});
 			});
 		},
 		},
-		round: function(number) {
+		round(number) {
 			return Math.round(number);
 			return Math.round(number);
 		}
 		}
 	}
 	}

+ 5 - 5
frontend/components/Admin/Users.vue

@@ -81,12 +81,12 @@ export default {
 		})
 		})
 	},
 	},
 	methods: {
 	methods: {
-		edit: function(user) {
+		edit(user) {
 			this.editUser(user);
 			this.editUser(user);
 			this.openModal({ sector: "admin", modal: "editUser" });
 			this.openModal({ sector: "admin", modal: "editUser" });
 		},
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.socket.emit("users.index", result => {
 			_this.socket.emit("users.index", result => {
 				if (result.status === "success") _this.users = result.data;
 				if (result.status === "success") _this.users = result.data;
 			});
 			});
@@ -98,8 +98,8 @@ export default {
 		...mapActions("admin/users", ["editUser"]),
 		...mapActions("admin/users", ["editUser"]),
 		...mapActions("modals", ["openModal"])
 		...mapActions("modals", ["openModal"])
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			if (_this.socket.connected) _this.init();
 			if (_this.socket.connected) _this.init();

+ 1 - 1
frontend/components/MainFooter.vue

@@ -73,7 +73,7 @@ export default {
 			}
 			}
 		};
 		};
 	},
 	},
-	mounted: function() {
+	mounted() {
 		lofig.get("siteSettings.socialLinks", res => {
 		lofig.get("siteSettings.socialLinks", res => {
 			this.socialLinks = res;
 			this.socialLinks = res;
 		});
 		});

+ 9 - 3
frontend/components/MainHeader.vue

@@ -89,9 +89,15 @@ export default {
 			}
 			}
 		};
 		};
 	},
 	},
-	mounted: function() {
-		lofig.get("frontendDomain", res => (this.frontendDomain = res));
-		lofig.get("siteSettings", res => (this.siteSettings = res));
+	mounted() {
+		lofig.get("frontendDomain", res => {
+			this.frontendDomain = res;
+			return res;
+		});
+		lofig.get("siteSettings", res => {
+			this.siteSettings = res;
+			return res;
+		});
 	},
 	},
 	computed: mapState("modals", {
 	computed: mapState("modals", {
 		modals: state => state.modals.header
 		modals: state => state.modals.header

+ 13 - 12
frontend/components/Modals/AddSongToPlaylist.vue

@@ -52,8 +52,8 @@ export default {
 			song: null
 			song: null
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		this.songId = this.$parent.currentSong.songId;
 		this.songId = this.$parent.currentSong.songId;
 		this.song = this.$parent.currentSong;
 		this.song = this.$parent.currentSong;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
@@ -69,8 +69,8 @@ export default {
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		addSongToPlaylist: function(playlistId) {
-			let _this = this;
+		addSongToPlaylist(playlistId) {
+			const _this = this;
 			this.socket.emit(
 			this.socket.emit(
 				"playlists.addSongToPlaylist",
 				"playlists.addSongToPlaylist",
 				this.$parent.currentSong.songId,
 				this.$parent.currentSong.songId,
@@ -81,12 +81,12 @@ export default {
 						_this.playlists[playlistId].songs.push(_this.song);
 						_this.playlists[playlistId].songs.push(_this.song);
 					}
 					}
 					_this.recalculatePlaylists();
 					_this.recalculatePlaylists();
-					//this.$parent.modals.addSongToPlaylist = false;
+					// this.$parent.modals.addSongToPlaylist = false;
 				}
 				}
 			);
 			);
 		},
 		},
-		removeSongFromPlaylist: function(playlistId) {
-			let _this = this;
+		removeSongFromPlaylist(playlistId) {
+			const _this = this;
 			this.socket.emit(
 			this.socket.emit(
 				"playlists.removeSongFromPlaylist",
 				"playlists.removeSongFromPlaylist",
 				_this.songId,
 				_this.songId,
@@ -105,21 +105,22 @@ export default {
 						);
 						);
 					}
 					}
 					_this.recalculatePlaylists();
 					_this.recalculatePlaylists();
-					//this.$parent.modals.addSongToPlaylist = false;
+					// this.$parent.modals.addSongToPlaylist = false;
 				}
 				}
 			);
 			);
 		},
 		},
-		recalculatePlaylists: function() {
-			let _this = this;
+		recalculatePlaylists() {
+			const _this = this;
 			_this.playlistsArr = Object.values(_this.playlists).map(
 			_this.playlistsArr = Object.values(_this.playlists).map(
 				playlist => {
 				playlist => {
 					let hasSong = false;
 					let hasSong = false;
-					for (let i = 0; i < playlist.songs.length; i++) {
+					for (let i = 0; i < playlist.songs.length; i += 1) {
 						if (playlist.songs[i].songId === _this.songId) {
 						if (playlist.songs[i].songId === _this.songId) {
 							hasSong = true;
 							hasSong = true;
 						}
 						}
 					}
 					}
-					playlist.hasSong = hasSong;
+
+					playlist.hasSong = hasSong; // eslint-disable-line no-param-reassign
 					_this.playlists[playlist._id] = playlist;
 					_this.playlists[playlist._id] = playlist;
 					return playlist;
 					return playlist;
 				}
 				}

+ 19 - 20
frontend/components/Modals/AddSongToQueue.vue

@@ -110,26 +110,26 @@ export default {
 		};
 		};
 	},
 	},
 	methods: {
 	methods: {
-		isPlaylistSelected: function(playlistId) {
+		isPlaylistSelected(playlistId) {
 			return this.privatePlaylistQueueSelected === playlistId;
 			return this.privatePlaylistQueueSelected === playlistId;
 		},
 		},
-		selectPlaylist: function(playlistId) {
-			let _this = this;
+		selectPlaylist(playlistId) {
+			const _this = this;
 			if (_this.$parent.type === "community") {
 			if (_this.$parent.type === "community") {
 				_this.privatePlaylistQueueSelected = playlistId;
 				_this.privatePlaylistQueueSelected = playlistId;
 				_this.$parent.privatePlaylistQueueSelected = playlistId;
 				_this.$parent.privatePlaylistQueueSelected = playlistId;
 				_this.$parent.addFirstPrivatePlaylistSongToQueue();
 				_this.$parent.addFirstPrivatePlaylistSongToQueue();
 			}
 			}
 		},
 		},
-		unSelectPlaylist: function() {
-			let _this = this;
+		unSelectPlaylist() {
+			const _this = this;
 			if (_this.$parent.type === "community") {
 			if (_this.$parent.type === "community") {
 				_this.privatePlaylistQueueSelected = null;
 				_this.privatePlaylistQueueSelected = null;
 				_this.$parent.privatePlaylistQueueSelected = null;
 				_this.$parent.privatePlaylistQueueSelected = null;
 			}
 			}
 		},
 		},
-		addSongToQueue: function(songId) {
-			let _this = this;
+		addSongToQueue(songId) {
+			const _this = this;
 			if (_this.$parent.type === "community") {
 			if (_this.$parent.type === "community") {
 				_this.socket.emit(
 				_this.socket.emit(
 					"stations.addToQueue",
 					"stations.addToQueue",
@@ -152,8 +152,8 @@ export default {
 				});
 				});
 			}
 			}
 		},
 		},
-		importPlaylist: function() {
-			let _this = this;
+		importPlaylist() {
+			const _this = this;
 			Toast.methods.addToast(
 			Toast.methods.addToast(
 				"Starting to import your playlist. This can take some time to do.",
 				"Starting to import your playlist. This can take some time to do.",
 				4000
 				4000
@@ -166,8 +166,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		submitQuery: function() {
-			let _this = this;
+		submitQuery() {
+			const _this = this;
 			let query = _this.querySearch;
 			let query = _this.querySearch;
 			if (query.indexOf("&index=") !== -1) {
 			if (query.indexOf("&index=") !== -1) {
 				query = query.split("&index=");
 				query = query.split("&index=");
@@ -179,24 +179,23 @@ export default {
 				query.pop();
 				query.pop();
 				query = query.join("");
 				query = query.join("");
 			}
 			}
-			_this.socket.emit("apis.searchYoutube", query, results => {
+			_this.socket.emit("apis.searchYoutube", query, res => {
 				// check for error
 				// check for error
-				results = results.data;
+				const { data } = res;
 				_this.queryResults = [];
 				_this.queryResults = [];
-				for (let i = 0; i < results.items.length; i++) {
+				for (let i = 0; i < data.items.length; i += 1) {
 					_this.queryResults.push({
 					_this.queryResults.push({
-						id: results.items[i].id.videoId,
+						id: data.items[i].id.videoId,
 						url: `https://www.youtube.com/watch?v=${this.id}`,
 						url: `https://www.youtube.com/watch?v=${this.id}`,
-						title: results.items[i].snippet.title,
-						thumbnail:
-							results.items[i].snippet.thumbnails.default.url
+						title: data.items[i].snippet.title,
+						thumbnail: data.items[i].snippet.thumbnails.default.url
 					});
 					});
 				}
 				}
 			});
 			});
 		}
 		}
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			_this.socket.emit("playlists.indexForUser", res => {
 			_this.socket.emit("playlists.indexForUser", res => {

+ 15 - 12
frontend/components/Modals/CreateCommunityStation.vue

@@ -57,17 +57,16 @@ export default {
 			}
 			}
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		submitModal: function() {
-			const name = this.newCommunity.name;
-			const displayName = this.newCommunity.displayName;
-			const description = this.newCommunity.description;
+		submitModal() {
+			const { name, displayName, description } = this.newCommunity;
+
 			if (!name || !displayName || !description)
 			if (!name || !displayName || !description)
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Please fill in all fields",
 					"Please fill in all fields",
@@ -79,6 +78,7 @@ export default {
 					"Name must have between 2 and 16 characters.",
 					"Name must have between 2 and 16 characters.",
 					8000
 					8000
 				);
 				);
+
 			if (!validation.regex.az09_.test(name))
 			if (!validation.regex.az09_.test(name))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Invalid name format. Allowed characters: a-z, 0-9 and _.",
 					"Invalid name format. Allowed characters: a-z, 0-9 and _.",
@@ -101,25 +101,28 @@ export default {
 					"Description must have between 2 and 200 characters.",
 					"Description must have between 2 and 200 characters.",
 					8000
 					8000
 				);
 				);
+
 			let characters = description.split("");
 			let characters = description.split("");
-			characters = characters.filter(function(character) {
+
+			characters = characters.filter(character => {
 				return character.charCodeAt(0) === 21328;
 				return character.charCodeAt(0) === 21328;
 			});
 			});
+
 			if (characters.length !== 0)
 			if (characters.length !== 0)
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Invalid description format. Swastika's are not allowed.",
 					"Invalid description format. Swastika's are not allowed.",
 					8000
 					8000
 				);
 				);
 
 
-			let _this = this;
+			const _this = this;
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.create",
 				"stations.create",
 				{
 				{
-					name: name,
+					name,
 					type: "community",
 					type: "community",
-					displayName: displayName,
-					description: description
+					displayName,
+					description
 				},
 				},
 				res => {
 				res => {
 					if (res.status === "success") {
 					if (res.status === "success") {

+ 4 - 3
frontend/components/Modals/EditNews.vue

@@ -180,8 +180,8 @@ import Modal from "./Modal.vue";
 export default {
 export default {
 	components: { Modal },
 	components: { Modal },
 	methods: {
 	methods: {
-		addChange: function(type) {
-			let change = document.getElementById(`edit-${type}`).value.trim();
+		addChange(type) {
+			const change = document.getElementById(`edit-${type}`).value.trim();
 
 
 			if (this.$parent.editing[type].indexOf(change) !== -1)
 			if (this.$parent.editing[type].indexOf(change) !== -1)
 				return Toast.methods.addToast(`Tag already exists`, 3000);
 				return Toast.methods.addToast(`Tag already exists`, 3000);
@@ -190,8 +190,9 @@ export default {
 			else Toast.methods.addToast(`${type} cannot be empty`, 3000);
 			else Toast.methods.addToast(`${type} cannot be empty`, 3000);
 
 
 			document.getElementById(`edit-${type}`).value = "";
 			document.getElementById(`edit-${type}`).value = "";
+			return true;
 		},
 		},
-		removeChange: function(type, index) {
+		removeChange(type, index) {
 			this.$parent.editing[type].splice(index, 1);
 			this.$parent.editing[type].splice(index, 1);
 		},
 		},
 		...mapActions("modals", ["closeModal"])
 		...mapActions("modals", ["closeModal"])

+ 89 - 61
frontend/components/Modals/EditSong.vue

@@ -317,8 +317,8 @@ export default {
 		})
 		})
 	},
 	},
 	methods: {
 	methods: {
-		save: function(song, close) {
-			let _this = this;
+		save(song, close) {
+			const _this = this;
 
 
 			if (!song.title)
 			if (!song.title)
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
@@ -348,11 +348,11 @@ export default {
 					"Title must have between 1 and 100 characters.",
 					"Title must have between 1 and 100 characters.",
 					8000
 					8000
 				);
 				);
-			/*if (!validation.regex.ascii.test(song.title))
+			/* if (!validation.regex.ascii.test(song.title))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Invalid title format. Only ascii characters are allowed.",
 					"Invalid title format. Only ascii characters are allowed.",
 					8000
 					8000
-				);*/
+				); */
 
 
 			// Artists
 			// Artists
 			if (song.artists.length < 1 || song.artists.length > 10)
 			if (song.artists.length < 1 || song.artists.length > 10)
@@ -362,27 +362,39 @@ export default {
 				);
 				);
 			let error;
 			let error;
 			song.artists.forEach(artist => {
 			song.artists.forEach(artist => {
-				if (!validation.isLength(artist, 1, 32))
-					return (error =
-						"Artist must have between 1 and 32 characters.");
-				if (!validation.regex.ascii.test(artist))
-					return (error =
-						"Invalid artist format. Only ascii characters are allowed.");
-				if (artist === "NONE")
-					return (error =
-						'Invalid artist format. Artists are not allowed to be named "NONE".');
+				if (!validation.isLength(artist, 1, 32)) {
+					error = "Artist must have between 1 and 32 characters.";
+					return error;
+				}
+				if (!validation.regex.ascii.test(artist)) {
+					error =
+						"Invalid artist format. Only ascii characters are allowed.";
+					return error;
+				}
+				if (artist === "NONE") {
+					error =
+						'Invalid artist format. Artists are not allowed to be named "NONE".';
+					return error;
+				}
+
+				return false;
 			});
 			});
 			if (error) return Toast.methods.addToast(error, 8000);
 			if (error) return Toast.methods.addToast(error, 8000);
 
 
 			// Genres
 			// Genres
 			error = undefined;
 			error = undefined;
 			song.genres.forEach(genre => {
 			song.genres.forEach(genre => {
-				if (!validation.isLength(genre, 1, 16))
-					return (error =
-						"Genre must have between 1 and 16 characters.");
-				if (!validation.regex.az09_.test(genre))
-					return (error =
-						"Invalid genre format. Only ascii characters are allowed.");
+				if (!validation.isLength(genre, 1, 16)) {
+					error = "Genre must have between 1 and 16 characters.";
+					return error;
+				}
+				if (!validation.regex.az09_.test(genre)) {
+					error =
+						"Invalid genre format. Only ascii characters are allowed.";
+					return error;
+				}
+
+				return false;
 			});
 			});
 			if (error) return Toast.methods.addToast(error, 8000);
 			if (error) return Toast.methods.addToast(error, 8000);
 
 
@@ -406,18 +418,20 @@ export default {
 				);
 				);
 			}
 			}
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				`${_this.editing.type}.update`,
 				`${_this.editing.type}.update`,
 				song._id,
 				song._id,
 				song,
 				song,
 				res => {
 				res => {
 					Toast.methods.addToast(res.message, 4000);
 					Toast.methods.addToast(res.message, 4000);
 					if (res.status === "success") {
 					if (res.status === "success") {
-						_this.$parent.songs.forEach(lSong => {
-							if (song._id === lSong._id) {
-								for (let n in song) {
-									lSong[n] = song[n];
-								}
+						_this.$parent.songs.forEach(originalSong => {
+							const updatedSong = song;
+							if (originalSong._id === updatedSong._id) {
+								Object.keys(originalSong).forEach(n => {
+									updatedSong[n] = originalSong[n];
+									return originalSong[n];
+								});
 							}
 							}
 						});
 						});
 					}
 					}
@@ -429,9 +443,11 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		settings: function(type) {
-			let _this = this;
+		settings(type) {
+			const _this = this;
 			switch (type) {
 			switch (type) {
+				default:
+					break;
 				case "stop":
 				case "stop":
 					_this.stopVideo();
 					_this.stopVideo();
 					_this.pauseVideo(true);
 					_this.pauseVideo(true);
@@ -451,16 +467,16 @@ export default {
 					break;
 					break;
 			}
 			}
 		},
 		},
-		changeVolume: function() {
-			let local = this;
-			let volume = document.getElementById("volumeSlider").value;
+		changeVolume() {
+			const local = this;
+			const volume = document.getElementById("volumeSlider").value;
 			localStorage.setItem("volume", volume);
 			localStorage.setItem("volume", volume);
 			local.video.player.setVolume(volume);
 			local.video.player.setVolume(volume);
 			if (volume > 0) local.video.player.unMute();
 			if (volume > 0) local.video.player.unMute();
 		},
 		},
-		addTag: function(type) {
-			if (type == "genres") {
-				let genre = document
+		addTag(type) {
+			if (type === "genres") {
+				const genre = document
 					.getElementById("new-genre")
 					.getElementById("new-genre")
 					.value.toLowerCase()
 					.value.toLowerCase()
 					.trim();
 					.trim();
@@ -469,9 +485,13 @@ export default {
 				if (genre) {
 				if (genre) {
 					this.editing.song.genres.push(genre);
 					this.editing.song.genres.push(genre);
 					document.getElementById("new-genre").value = "";
 					document.getElementById("new-genre").value = "";
-				} else Toast.methods.addToast("Genre cannot be empty", 3000);
-			} else if (type == "artists") {
-				let artist = document.getElementById("new-artist").value;
+					return false;
+				}
+
+				return Toast.methods.addToast("Genre cannot be empty", 3000);
+			}
+			if (type === "artists") {
+				const artist = document.getElementById("new-artist").value;
 				if (this.editing.song.artists.indexOf(artist) !== -1)
 				if (this.editing.song.artists.indexOf(artist) !== -1)
 					return Toast.methods.addToast(
 					return Toast.methods.addToast(
 						"Artist already exists",
 						"Artist already exists",
@@ -480,15 +500,19 @@ export default {
 				if (document.getElementById("new-artist").value !== "") {
 				if (document.getElementById("new-artist").value !== "") {
 					this.editing.song.artists.push(artist);
 					this.editing.song.artists.push(artist);
 					document.getElementById("new-artist").value = "";
 					document.getElementById("new-artist").value = "";
-				} else Toast.methods.addToast("Artist cannot be empty", 3000);
+					return false;
+				}
+				return Toast.methods.addToast("Artist cannot be empty", 3000);
 			}
 			}
+
+			return false;
 		},
 		},
-		removeTag: function(type, index) {
-			if (type == "genres") this.editing.song.genres.splice(index, 1);
-			else if (type == "artists")
+		removeTag(type, index) {
+			if (type === "genres") this.editing.song.genres.splice(index, 1);
+			else if (type === "artists")
 				this.editing.song.artists.splice(index, 1);
 				this.editing.song.artists.splice(index, 1);
 		},
 		},
-		getSpotifySongs: function() {
+		getSpotifySongs() {
 			this.socket.emit(
 			this.socket.emit(
 				"apis.getSpotifySongs",
 				"apis.getSpotifySongs",
 				this.spotify.title,
 				this.spotify.title,
@@ -510,9 +534,9 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		initCanvas: function() {
-			let canvasElement = document.getElementById("durationCanvas");
-			let ctx = canvasElement.getContext("2d");
+		initCanvas() {
+			const canvasElement = document.getElementById("durationCanvas");
+			const ctx = canvasElement.getContext("2d");
 
 
 			const skipDurationColor = "#ef4a1c";
 			const skipDurationColor = "#ef4a1c";
 			const durationColor = "#1dc146";
 			const durationColor = "#1dc146";
@@ -538,9 +562,9 @@ export default {
 			ctx.fillStyle = "#000000";
 			ctx.fillStyle = "#000000";
 			ctx.fillText("After duration", 255, 38);
 			ctx.fillText("After duration", 255, 38);
 		},
 		},
-		drawCanvas: function() {
-			let canvasElement = document.getElementById("durationCanvas");
-			let ctx = canvasElement.getContext("2d");
+		drawCanvas() {
+			const canvasElement = document.getElementById("durationCanvas");
+			const ctx = canvasElement.getContext("2d");
 
 
 			const videoDuration = Number(this.youtubeVideoDuration);
 			const videoDuration = Number(this.youtubeVideoDuration);
 
 
@@ -552,11 +576,11 @@ export default {
 
 
 			const currentTime = this.video.player.getCurrentTime();
 			const currentTime = this.video.player.getCurrentTime();
 
 
-			let widthSkipDuration = (skipDuration / videoDuration) * width;
-			let widthDuration = (duration / videoDuration) * width;
-			let widthAfterDuration = (afterDuration / videoDuration) * width;
+			const widthSkipDuration = (skipDuration / videoDuration) * width;
+			const widthDuration = (duration / videoDuration) * width;
+			const widthAfterDuration = (afterDuration / videoDuration) * width;
 
 
-			let widthCurrentTime = (currentTime / videoDuration) * width;
+			const widthCurrentTime = (currentTime / videoDuration) * width;
 
 
 			const skipDurationColor = "#ef4a1c";
 			const skipDurationColor = "#ef4a1c";
 			const durationColor = "#1dc146";
 			const durationColor = "#1dc146";
@@ -587,8 +611,8 @@ export default {
 		]),
 		]),
 		...mapActions("modals", ["closeModal"])
 		...mapActions("modals", ["closeModal"])
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 
 
 		// if (this.modals.editSong = false) this.video.player.stopVideo();
 		// if (this.modals.editSong = false) this.video.player.stopVideo();
 
 
@@ -629,9 +653,10 @@ export default {
 				_this.video.player.stopVideo();
 				_this.video.player.stopVideo();
 			}
 			}
 			if (this.playerReady) {
 			if (this.playerReady) {
-				_this
-					.getCurrentTime(3)
-					.then(time => (this.youtubeVideoCurrentTime = time));
+				_this.getCurrentTime(3).then(time => {
+					this.youtubeVideoCurrentTime = time;
+					return time;
+				});
 			}
 			}
 
 
 			if (_this.video.paused === false) _this.drawCanvas();
 			if (_this.video.paused === false) _this.drawCanvas();
@@ -653,7 +678,7 @@ export default {
 				onReady: () => {
 				onReady: () => {
 					let volume = parseInt(localStorage.getItem("volume"));
 					let volume = parseInt(localStorage.getItem("volume"));
 					volume = typeof volume === "number" ? volume : 20;
 					volume = typeof volume === "number" ? volume : 20;
-					console.log("Seekto: " + _this.editing.song.skipDuration);
+					console.log(`Seekto: ${_this.editing.song.skipDuration}`);
 					_this.video.player.seekTo(_this.editing.song.skipDuration);
 					_this.video.player.seekTo(_this.editing.song.skipDuration);
 					_this.video.player.setVolume(volume);
 					_this.video.player.setVolume(volume);
 					if (volume > 0) _this.video.player.unMute();
 					if (volume > 0) _this.video.player.unMute();
@@ -678,14 +703,15 @@ export default {
 						if (_this.editing.song.duration > youtubeDuration + 1) {
 						if (_this.editing.song.duration > youtubeDuration + 1) {
 							this.video.player.stopVideo();
 							this.video.player.stopVideo();
 							_this.video.paused = true;
 							_this.video.paused = true;
-							Toast.methods.addToast(
+							return Toast.methods.addToast(
 								"Video can't play. Specified duration is bigger than the YouTube song duration.",
 								"Video can't play. Specified duration is bigger than the YouTube song duration.",
 								4000
 								4000
 							);
 							);
-						} else if (_this.editing.song.duration <= 0) {
+						}
+						if (_this.editing.song.duration <= 0) {
 							this.video.player.stopVideo();
 							this.video.player.stopVideo();
 							_this.video.paused = true;
 							_this.video.paused = true;
-							Toast.methods.addToast(
+							return Toast.methods.addToast(
 								"Video can't play. Specified duration has to be more than 0 seconds.",
 								"Video can't play. Specified duration has to be more than 0 seconds.",
 								4000
 								4000
 							);
 							);
@@ -695,13 +721,15 @@ export default {
 							_this.video.player.getCurrentTime() <
 							_this.video.player.getCurrentTime() <
 							_this.editing.song.skipDuration
 							_this.editing.song.skipDuration
 						) {
 						) {
-							_this.video.player.seekTo(
+							return _this.video.player.seekTo(
 								_this.editing.song.skipDuration
 								_this.editing.song.skipDuration
 							);
 							);
 						}
 						}
 					} else if (event.data === 2) {
 					} else if (event.data === 2) {
 						this.video.paused = true;
 						this.video.paused = true;
 					}
 					}
+
+					return false;
 				}
 				}
 			}
 			}
 		});
 		});

+ 89 - 59
frontend/components/Modals/EditStation.vue

@@ -104,12 +104,15 @@ export default {
 		station: state => state.station,
 		station: state => state.station,
 		editing: state => state.editing
 		editing: state => state.editing
 	}),
 	}),
-	mounted: function() {
-		let _this = this;
-		io.getSocket(socket => (_this.socket = socket));
+	mounted() {
+		const _this = this;
+		io.getSocket(socket => {
+			_this.socket = socket;
+			return socket;
+		});
 	},
 	},
 	methods: {
 	methods: {
-		update: function() {
+		update() {
 			if (this.station.name !== this.editing.name) this.updateName();
 			if (this.station.name !== this.editing.name) this.updateName();
 			if (this.station.displayName !== this.editing.displayName)
 			if (this.station.displayName !== this.editing.displayName)
 				this.updateDisplayName();
 				this.updateDisplayName();
@@ -120,8 +123,8 @@ export default {
 			if (this.station.partyMode !== this.editing.partyMode)
 			if (this.station.partyMode !== this.editing.partyMode)
 				this.updatePartyMode();
 				this.updatePartyMode();
 		},
 		},
-		updateName: function() {
-			const name = this.editing.name;
+		updateName() {
+			const { name } = this.editing;
 			if (!validation.isLength(name, 2, 16))
 			if (!validation.isLength(name, 2, 16))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Name must have between 2 and 16 characters.",
 					"Name must have between 2 and 16 characters.",
@@ -133,28 +136,33 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateName",
 				"stations.updateName",
 				this.editing._id,
 				this.editing._id,
 				name,
 				name,
 				res => {
 				res => {
 					if (res.status === "success") {
 					if (res.status === "success") {
-						if (this.station) this.station.name = name;
-						else {
-							this.$parent.stations.forEach((station, index) => {
-								if (station._id === this.editing._id)
-									return (this.$parent.stations[
-										index
-									].name = name);
-							});
+						if (this.station) {
+							this.station.name = name;
+							return name;
 						}
 						}
+
+						this.$parent.stations.forEach((station, index) => {
+							if (station._id === this.editing._id) {
+								this.$parent.stations[index].name = name;
+								return name;
+							}
+
+							return false;
+						});
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		updateDisplayName: function() {
-			const displayName = this.editing.displayName;
+		updateDisplayName() {
+			const { displayName } = this.editing;
 			if (!validation.isLength(displayName, 2, 32))
 			if (!validation.isLength(displayName, 2, 32))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Display name must have between 2 and 32 characters.",
 					"Display name must have between 2 and 32 characters.",
@@ -166,7 +174,7 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateDisplayName",
 				"stations.updateDisplayName",
 				this.editing._id,
 				this.editing._id,
 				displayName,
 				displayName,
@@ -177,9 +185,10 @@ export default {
 						else {
 						else {
 							this.$parent.stations.forEach((station, index) => {
 							this.$parent.stations.forEach((station, index) => {
 								if (station._id === this.editing._id)
 								if (station._id === this.editing._id)
-									return (this.$parent.stations[
+									this.$parent.stations[
 										index
 										index
-									].displayName = displayName);
+									].displayName = displayName;
+								return displayName;
 							});
 							});
 						}
 						}
 					}
 					}
@@ -187,96 +196,117 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		updateDescription: function() {
-			let _this = this;
+		updateDescription() {
+			const _this = this;
 
 
-			const description = this.editing.description;
+			const { description } = this.editing;
 			if (!validation.isLength(description, 2, 200))
 			if (!validation.isLength(description, 2, 200))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Description must have between 2 and 200 characters.",
 					"Description must have between 2 and 200 characters.",
 					8000
 					8000
 				);
 				);
+
 			let characters = description.split("");
 			let characters = description.split("");
 			characters = characters.filter(character => {
 			characters = characters.filter(character => {
 				return character.charCodeAt(0) === 21328;
 				return character.charCodeAt(0) === 21328;
 			});
 			});
+
 			if (characters.length !== 0)
 			if (characters.length !== 0)
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Invalid description format. Swastika's are not allowed.",
 					"Invalid description format. Swastika's are not allowed.",
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateDescription",
 				"stations.updateDescription",
 				this.editing._id,
 				this.editing._id,
 				description,
 				description,
 				res => {
 				res => {
 					if (res.status === "success") {
 					if (res.status === "success") {
-						if (_this.station)
+						if (_this.station) {
 							_this.station.description = description;
 							_this.station.description = description;
-						else {
-							_this.$parent.stations.forEach((station, index) => {
-								if (station._id === station._id)
-									return (_this.$parent.stations[
-										index
-									].description = description);
-							});
+							return description;
 						}
 						}
+
+						_this.$parent.stations.forEach((station, index) => {
+							if (station._id === this.editing._id) {
+								_this.$parent.stations[
+									index
+								].description = description;
+								return description;
+							}
+
+							return false;
+						});
+
 						return Toast.methods.addToast(res.message, 4000);
 						return Toast.methods.addToast(res.message, 4000);
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		updatePrivacy: function() {
-			let _this = this;
-			this.socket.emit(
+		updatePrivacy() {
+			const _this = this;
+			return this.socket.emit(
 				"stations.updatePrivacy",
 				"stations.updatePrivacy",
 				this.editing._id,
 				this.editing._id,
 				this.editing.privacy,
 				this.editing.privacy,
 				res => {
 				res => {
 					if (res.status === "success") {
 					if (res.status === "success") {
-						if (_this.station)
+						if (_this.station) {
 							_this.station.privacy = _this.editing.privacy;
 							_this.station.privacy = _this.editing.privacy;
-						else {
-							_this.$parent.stations.forEach((station, index) => {
-								if (station._id === station._id)
-									return (_this.$parent.stations[
-										index
-									].privacy = _this.editing.privacy);
-							});
+							return _this.editing.privacy;
 						}
 						}
+
+						_this.$parent.stations.forEach((station, index) => {
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[index].privacy =
+									_this.editing.privacy;
+								return _this.editing.privacy;
+							}
+
+							return false;
+						});
+
 						return Toast.methods.addToast(res.message, 4000);
 						return Toast.methods.addToast(res.message, 4000);
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		updatePartyMode: function() {
-			let _this = this;
-			this.socket.emit(
+		updatePartyMode() {
+			const _this = this;
+			return this.socket.emit(
 				"stations.updatePartyMode",
 				"stations.updatePartyMode",
 				this.editing._id,
 				this.editing._id,
 				this.editing.partyMode,
 				this.editing.partyMode,
 				res => {
 				res => {
 					if (res.status === "success") {
 					if (res.status === "success") {
-						if (_this.station)
+						if (_this.station) {
 							_this.station.partyMode = _this.editing.partyMode;
 							_this.station.partyMode = _this.editing.partyMode;
-						else {
-							_this.$parent.stations.forEach((station, index) => {
-								if (station._id === station._id)
-									return (_this.$parent.stations[
-										index
-									].partyMode = _this.editing.partyMode);
-							});
+							return _this.editing.partyMode;
 						}
 						}
+
+						_this.$parent.stations.forEach((station, index) => {
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[index].partyMode =
+									_this.editing.partyMode;
+								return _this.editing.partyMode;
+							}
+
+							return false;
+						});
+
 						return Toast.methods.addToast(res.message, 4000);
 						return Toast.methods.addToast(res.message, 4000);
 					}
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 				}
 			);
 			);
 		},
 		},
-		deleteStation: function() {
+		deleteStation() {
 			this.socket.emit("stations.remove", this.editing._id, res => {
 			this.socket.emit("stations.remove", this.editing._id, res => {
 				Toast.methods.addToast(res.message, 8000);
 				Toast.methods.addToast(res.message, 8000);
 			});
 			});

+ 18 - 15
frontend/components/Modals/EditUser.vue

@@ -112,8 +112,8 @@ export default {
 		})
 		})
 	},
 	},
 	methods: {
 	methods: {
-		updateUsername: function() {
-			const username = this.editing.username;
+		updateUsername() {
+			const { username } = this.editing;
 			if (!validation.isLength(username, 2, 32))
 			if (!validation.isLength(username, 2, 32))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Username must have between 2 and 32 characters.",
 					"Username must have between 2 and 32 characters.",
@@ -125,7 +125,7 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				`users.updateUsername`,
 				`users.updateUsername`,
 				this.editing._id,
 				this.editing._id,
 				username,
 				username,
@@ -134,8 +134,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		updateEmail: function() {
-			const email = this.editing.email;
+		updateEmail() {
+			const { email } = this.editing;
 			if (!validation.isLength(email, 3, 254))
 			if (!validation.isLength(email, 3, 254))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Email must have between 3 and 254 characters.",
 					"Email must have between 3 and 254 characters.",
@@ -147,7 +147,7 @@ export default {
 			)
 			)
 				return Toast.methods.addToast("Invalid email format.", 8000);
 				return Toast.methods.addToast("Invalid email format.", 8000);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				`users.updateEmail`,
 				`users.updateEmail`,
 				this.editing._id,
 				this.editing._id,
 				email,
 				email,
@@ -156,7 +156,7 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		updateRole: function() {
+		updateRole() {
 			this.socket.emit(
 			this.socket.emit(
 				`users.updateRole`,
 				`users.updateRole`,
 				this.editing._id,
 				this.editing._id,
@@ -168,12 +168,12 @@ export default {
 						this.editing.role === "default" &&
 						this.editing.role === "default" &&
 						this.editing._id === this.$parent.$parent.$parent.userId
 						this.editing._id === this.$parent.$parent.$parent.userId
 					)
 					)
-						location.reload();
+						window.location.reload();
 				}
 				}
 			);
 			);
 		},
 		},
-		banUser: function() {
-			const reason = this.ban.reason;
+		banUser() {
+			const { reason } = this.ban;
 			if (!validation.isLength(reason, 1, 64))
 			if (!validation.isLength(reason, 1, 64))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Reason must have between 1 and 64 characters.",
 					"Reason must have between 1 and 64 characters.",
@@ -185,7 +185,7 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				`users.banUserById`,
 				`users.banUserById`,
 				this.editing._id,
 				this.editing._id,
 				this.ban.reason,
 				this.ban.reason,
@@ -195,16 +195,19 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		removeSessions: function() {
+		removeSessions() {
 			this.socket.emit(`users.removeSessions`, this.editing._id, res => {
 			this.socket.emit(`users.removeSessions`, this.editing._id, res => {
 				Toast.methods.addToast(res.message, 4000);
 				Toast.methods.addToast(res.message, 4000);
 			});
 			});
 		},
 		},
 		...mapActions("modals", ["closeModal"])
 		...mapActions("modals", ["closeModal"])
 	},
 	},
-	mounted: function() {
-		let _this = this;
-		io.getSocket(socket => (_this.socket = socket));
+	mounted() {
+		const _this = this;
+		io.getSocket(socket => {
+			_this.socket = socket;
+			return socket;
+		});
 	}
 	}
 };
 };
 </script>
 </script>

+ 1 - 1
frontend/components/Modals/IssuesModal.vue

@@ -83,7 +83,7 @@ export default {
 			report: state => state.report
 			report: state => state.report
 		})
 		})
 	},
 	},
-	mounted: function() {
+	mounted() {
 		if (this.$route.query.returnToSong) {
 		if (this.$route.query.returnToSong) {
 			this.closeModal({ sector: "admin", modal: "editSong" });
 			this.closeModal({ sector: "admin", modal: "editSong" });
 		}
 		}

+ 5 - 5
frontend/components/Modals/Login.vue

@@ -83,28 +83,28 @@ import { mapActions } from "vuex";
 import { Toast } from "vue-roaster";
 import { Toast } from "vue-roaster";
 
 
 export default {
 export default {
-	data: function() {
+	data() {
 		return {
 		return {
 			email: "",
 			email: "",
 			password: ""
 			password: ""
 		};
 		};
 	},
 	},
 	methods: {
 	methods: {
-		submitModal: function() {
+		submitModal() {
 			this.login({
 			this.login({
 				email: this.email,
 				email: this.email,
 				password: this.password
 				password: this.password
 			})
 			})
 				.then(res => {
 				.then(res => {
-					if (res.status == "success") location.reload();
+					if (res.status === "success") window.location.reload();
 				})
 				})
 				.catch(err => Toast.methods.addToast(err.message, 5000));
 				.catch(err => Toast.methods.addToast(err.message, 5000));
 		},
 		},
-		resetPassword: function() {
+		resetPassword() {
 			this.closeModal({ sector: "header", modal: "login" });
 			this.closeModal({ sector: "header", modal: "login" });
 			this.$router.go("/reset_password");
 			this.$router.go("/reset_password");
 		},
 		},
-		githubRedirect: function() {
+		githubRedirect() {
 			localStorage.setItem("github_redirect", this.$route.path);
 			localStorage.setItem("github_redirect", this.$route.path);
 		},
 		},
 		...mapActions("modals", ["closeModal"]),
 		...mapActions("modals", ["closeModal"]),

+ 4 - 4
frontend/components/Modals/MobileAlert.vue

@@ -22,15 +22,15 @@ export default {
 			isModalActive: false
 			isModalActive: false
 		};
 		};
 	},
 	},
-	mounted: function() {
+	mounted() {
 		if (!localStorage.getItem("mobileOptimization")) {
 		if (!localStorage.getItem("mobileOptimization")) {
 			this.toggleModal();
 			this.toggleModal();
 			localStorage.setItem("mobileOptimization", true);
 			localStorage.setItem("mobileOptimization", true);
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
-		toggleModal: function() {
-			let _this = this;
+		toggleModal() {
+			const _this = this;
 			_this.isModalActive = !_this.isModalActive;
 			_this.isModalActive = !_this.isModalActive;
 			if (_this.isModalActive) {
 			if (_this.isModalActive) {
 				setTimeout(() => {
 				setTimeout(() => {
@@ -40,7 +40,7 @@ export default {
 		}
 		}
 	},
 	},
 	events: {
 	events: {
-		closeModal: function() {
+		closeModal() {
 			this.isModalActive = false;
 			this.isModalActive = false;
 		}
 		}
 	}
 	}

+ 1 - 1
frontend/components/Modals/Modal.vue

@@ -38,7 +38,7 @@ export default {
 		},
 		},
 		...mapActions("modals", ["closeCurrentModal"])
 		...mapActions("modals", ["closeCurrentModal"])
 	},
 	},
-	mounted: function() {
+	mounted() {
 		this.type = this.toCamelCase(this.title);
 		this.type = this.toCamelCase(this.title);
 	}
 	}
 };
 };

+ 5 - 5
frontend/components/Modals/Playlists/Create.vue

@@ -40,15 +40,15 @@ export default {
 			}
 			}
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		createPlaylist: function() {
-			const displayName = this.playlist.displayName;
+		createPlaylist() {
+			const { displayName } = this.playlist;
 			if (!validation.isLength(displayName, 2, 32))
 			if (!validation.isLength(displayName, 2, 32))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Display name must have between 2 and 32 characters.",
 					"Display name must have between 2 and 32 characters.",
@@ -60,7 +60,7 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit("playlists.create", this.playlist, res => {
+			return this.socket.emit("playlists.create", this.playlist, res => {
 				Toast.methods.addToast(res.message, 3000);
 				Toast.methods.addToast(res.message, 3000);
 
 
 				if (res.status === "success") {
 				if (res.status === "success") {

+ 49 - 50
frontend/components/Modals/Playlists/Edit.vue

@@ -155,8 +155,8 @@ export default {
 	computed: mapState("user/playlists", {
 	computed: mapState("user/playlists", {
 		editing: state => state.editing
 		editing: state => state.editing
 	}),
 	}),
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			_this.socket.emit("playlists.getPlaylist", _this.editing, res => {
 			_this.socket.emit("playlists.getPlaylist", _this.editing, res => {
@@ -185,7 +185,7 @@ export default {
 					_this.playlist.songs.forEach((song, index) => {
 					_this.playlist.songs.forEach((song, index) => {
 						if (song.songId === data.songId) songIndex = index;
 						if (song.songId === data.songId) songIndex = index;
 					});
 					});
-					let song = _this.playlist.songs.splice(songIndex, 1)[0];
+					const song = _this.playlist.songs.splice(songIndex, 1)[0];
 					_this.playlist.songs.push(song);
 					_this.playlist.songs.push(song);
 				}
 				}
 			});
 			});
@@ -195,53 +195,52 @@ export default {
 					_this.playlist.songs.forEach((song, index) => {
 					_this.playlist.songs.forEach((song, index) => {
 						if (song.songId === data.songId) songIndex = index;
 						if (song.songId === data.songId) songIndex = index;
 					});
 					});
-					let song = _this.playlist.songs.splice(songIndex, 1)[0];
+					const song = _this.playlist.songs.splice(songIndex, 1)[0];
 					_this.playlist.songs.unshift(song);
 					_this.playlist.songs.unshift(song);
 				}
 				}
 			});
 			});
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		formatTime: function(length) {
-			let duration = moment.duration(length, "seconds");
+		formatTime(length) {
+			const duration = moment.duration(length, "seconds");
 			function getHours() {
 			function getHours() {
 				return Math.floor(duration.asHours());
 				return Math.floor(duration.asHours());
 			}
 			}
 			if (length <= 0) return "0 seconds";
 			if (length <= 0) return "0 seconds";
-			else
-				return (
-					(getHours() > 0
-						? getHours() > 1
-							? getHours() < 10
-								? "0" + getHours() + " hours "
-								: getHours() + " hours "
-							: "0" + getHours() + " hour "
-						: "") +
-					(duration.minutes() > 0
-						? duration.minutes() > 1
-							? duration.minutes() < 10
-								? "0" + duration.minutes() + " minutes "
-								: duration.minutes() + " minutes "
-							: "0" + duration.minutes() + " minute "
-						: "") +
-					(duration.seconds() > 0
-						? duration.seconds() > 1
-							? duration.seconds() < 10
-								? "0" + duration.seconds() + " seconds "
-								: duration.seconds() + " seconds "
-							: "0" + duration.seconds() + " second "
-						: "")
-				);
+			return (
+				(getHours() > 0
+					? getHours() > 1
+						? getHours() < 10
+							? `0${getHours()} hours `
+							: `${getHours()} hours `
+						: `0${getHours()} hour `
+					: "") +
+				(duration.minutes() > 0
+					? duration.minutes() > 1
+						? duration.minutes() < 10
+							? `0${duration.minutes()} minutes `
+							: `${duration.minutes()} minutes `
+						: `0${duration.minutes()} minute `
+					: "") +
+				(duration.seconds() > 0
+					? duration.seconds() > 1
+						? duration.seconds() < 10
+							? `0${duration.seconds()} seconds `
+							: `${duration.seconds()} seconds `
+						: `0${duration.seconds()} second `
+					: "")
+			);
 		},
 		},
-		totalLength: function() {
+		totalLength() {
 			let length = 0;
 			let length = 0;
 			this.playlist.songs.forEach(song => {
 			this.playlist.songs.forEach(song => {
 				length += song.duration;
 				length += song.duration;
 			});
 			});
 			return this.formatTime(length);
 			return this.formatTime(length);
 		},
 		},
-		searchForSongs: function() {
-			let _this = this;
+		searchForSongs() {
+			const _this = this;
 			let query = _this.songQuery;
 			let query = _this.songQuery;
 			if (query.indexOf("&index=") !== -1) {
 			if (query.indexOf("&index=") !== -1) {
 				query = query.split("&index=");
 				query = query.split("&index=");
@@ -254,9 +253,9 @@ export default {
 				query = query.join("");
 				query = query.join("");
 			}
 			}
 			_this.socket.emit("apis.searchYoutube", query, res => {
 			_this.socket.emit("apis.searchYoutube", query, res => {
-				if (res.status == "success") {
+				if (res.status === "success") {
 					_this.songQueryResults = [];
 					_this.songQueryResults = [];
-					for (let i = 0; i < res.data.items.length; i++) {
+					for (let i = 0; i < res.data.items.length; i += 1) {
 						_this.songQueryResults.push({
 						_this.songQueryResults.push({
 							id: res.data.items[i].id.videoId,
 							id: res.data.items[i].id.videoId,
 							url: `https://www.youtube.com/watch?v=${this.id}`,
 							url: `https://www.youtube.com/watch?v=${this.id}`,
@@ -269,8 +268,8 @@ export default {
 					Toast.methods.addToast(res.message, 3000);
 					Toast.methods.addToast(res.message, 3000);
 			});
 			});
 		},
 		},
-		addSongToPlaylist: function(id) {
-			let _this = this;
+		addSongToPlaylist(id) {
+			const _this = this;
 			_this.socket.emit(
 			_this.socket.emit(
 				"playlists.addSongToPlaylist",
 				"playlists.addSongToPlaylist",
 				id,
 				id,
@@ -280,8 +279,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		importPlaylist: function() {
-			let _this = this;
+		importPlaylist() {
+			const _this = this;
 			Toast.methods.addToast(
 			Toast.methods.addToast(
 				"Starting to import your playlist. This can take some time to do.",
 				"Starting to import your playlist. This can take some time to do.",
 				4000
 				4000
@@ -297,8 +296,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		removeSongFromPlaylist: function(id) {
-			let _this = this;
+		removeSongFromPlaylist(id) {
+			const _this = this;
 			this.socket.emit(
 			this.socket.emit(
 				"playlists.removeSongFromPlaylist",
 				"playlists.removeSongFromPlaylist",
 				id,
 				id,
@@ -308,8 +307,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		renamePlaylist: function() {
-			const displayName = this.playlist.displayName;
+		renamePlaylist() {
+			const { displayName } = this.playlist;
 			if (!validation.isLength(displayName, 2, 32))
 			if (!validation.isLength(displayName, 2, 32))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Display name must have between 2 and 32 characters.",
 					"Display name must have between 2 and 32 characters.",
@@ -321,7 +320,7 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"playlists.updateDisplayName",
 				"playlists.updateDisplayName",
 				this.playlist._id,
 				this.playlist._id,
 				this.playlist.displayName,
 				this.playlist.displayName,
@@ -330,8 +329,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		removePlaylist: function() {
-			let _this = this;
+		removePlaylist() {
+			const _this = this;
 			_this.socket.emit("playlists.remove", _this.playlist._id, res => {
 			_this.socket.emit("playlists.remove", _this.playlist._id, res => {
 				Toast.methods.addToast(res.message, 3000);
 				Toast.methods.addToast(res.message, 3000);
 				if (res.status === "success") {
 				if (res.status === "success") {
@@ -340,8 +339,8 @@ export default {
 				}
 				}
 			});
 			});
 		},
 		},
-		promoteSong: function(songId) {
-			let _this = this;
+		promoteSong(songId) {
+			const _this = this;
 			_this.socket.emit(
 			_this.socket.emit(
 				"playlists.moveSongToTop",
 				"playlists.moveSongToTop",
 				_this.playlist._id,
 				_this.playlist._id,
@@ -351,8 +350,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		demoteSong: function(songId) {
-			let _this = this;
+		demoteSong(songId) {
+			const _this = this;
 			_this.socket.emit(
 			_this.socket.emit(
 				"playlists.moveSongToBottom",
 				"playlists.moveSongToBottom",
 				_this.playlist._id,
 				_this.playlist._id,

+ 6 - 6
frontend/components/Modals/Register.vue

@@ -98,12 +98,12 @@ export default {
 			}
 			}
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		lofig.get("recaptcha", obj => {
 		lofig.get("recaptcha", obj => {
 			_this.recaptcha.key = obj.key;
 			_this.recaptcha.key = obj.key;
 
 
-			let recaptchaScript = document.createElement("script");
+			const recaptchaScript = document.createElement("script");
 			recaptchaScript.onload = () => {
 			recaptchaScript.onload = () => {
 				grecaptcha.ready(() => {
 				grecaptcha.ready(() => {
 					grecaptcha
 					grecaptcha
@@ -122,7 +122,7 @@ export default {
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		submitModal: function() {
+		submitModal() {
 			console.log(this.recaptcha.token);
 			console.log(this.recaptcha.token);
 
 
 			this.register({
 			this.register({
@@ -132,11 +132,11 @@ export default {
 				recaptchaToken: this.recaptcha.token
 				recaptchaToken: this.recaptcha.token
 			})
 			})
 				.then(res => {
 				.then(res => {
-					if (res.status == "success") location.reload();
+					if (res.status === "success") window.location.reload();
 				})
 				})
 				.catch(err => Toast.methods.addToast(err.message, 5000));
 				.catch(err => Toast.methods.addToast(err.message, 5000));
 		},
 		},
-		githubRedirect: function() {
+		githubRedirect() {
 			localStorage.setItem("github_redirect", this.$route.path);
 			localStorage.setItem("github_redirect", this.$route.path);
 		},
 		},
 		...mapActions("modals", ["closeModal"]),
 		...mapActions("modals", ["closeModal"]),

+ 12 - 12
frontend/components/Modals/Report.vue

@@ -216,43 +216,43 @@ export default {
 			]
 			]
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		create: function() {
-			let _this = this;
+		create() {
+			const _this = this;
 			console.log(this.report);
 			console.log(this.report);
 			_this.socket.emit("reports.create", _this.report, res => {
 			_this.socket.emit("reports.create", _this.report, res => {
 				Toast.methods.addToast(res.message, 4000);
 				Toast.methods.addToast(res.message, 4000);
-				if (res.status == "success")
+				if (res.status === "success")
 					_this.closeModal({
 					_this.closeModal({
 						sector: "station",
 						sector: "station",
 						modal: "report"
 						modal: "report"
 					});
 					});
 			});
 			});
 		},
 		},
-		updateCharactersRemaining: function() {
+		updateCharactersRemaining() {
 			this.charactersRemaining =
 			this.charactersRemaining =
 				400 - document.getElementsByClassName("textarea").value.length;
 				400 - document.getElementsByClassName("textarea").value.length;
 		},
 		},
-		highlight: function(type) {
-			if (type == "currentSong") {
+		highlight(type) {
+			if (type === "currentSong") {
 				this.report.songId = this.$parent.currentSong.songId;
 				this.report.songId = this.$parent.currentSong.songId;
 				this.isPreviousSongActive = false;
 				this.isPreviousSongActive = false;
 				this.isCurrentSongActive = true;
 				this.isCurrentSongActive = true;
-			} else if (type == "previousSong") {
+			} else if (type === "previousSong") {
 				this.report.songId = this.$parent.previousSong.songId;
 				this.report.songId = this.$parent.previousSong.songId;
 				this.isCurrentSongActive = false;
 				this.isCurrentSongActive = false;
 				this.isPreviousSongActive = true;
 				this.isPreviousSongActive = true;
 			}
 			}
 		},
 		},
-		toggleIssue: function(name, reason) {
-			for (let z = 0; z < this.report.issues.length; z++) {
-				if (this.report.issues[z].name == name) {
+		toggleIssue(name, reason) {
+			for (let z = 0; z < this.report.issues.length; z += 1) {
+				if (this.report.issues[z].name === name) {
 					if (this.report.issues[z].reasons.indexOf(reason) > -1) {
 					if (this.report.issues[z].reasons.indexOf(reason) > -1) {
 						this.report.issues[z].reasons.splice(
 						this.report.issues[z].reasons.splice(
 							this.report.issues[z].reasons.indexOf(reason),
 							this.report.issues[z].reasons.indexOf(reason),

+ 6 - 3
frontend/components/Modals/ViewPunishment.vue

@@ -74,9 +74,12 @@ export default {
 			punishment: state => state.punishment
 			punishment: state => state.punishment
 		})
 		})
 	},
 	},
-	mounted: function() {
-		let _this = this;
-		io.getSocket(socket => (_this.socket = socket));
+	mounted() {
+		const _this = this;
+		io.getSocket(socket => {
+			_this.socket = socket;
+			return socket;
+		});
 	},
 	},
 	methods: {
 	methods: {
 		...mapActions("modals", ["closeModal"])
 		...mapActions("modals", ["closeModal"])

+ 6 - 8
frontend/components/Modals/WhatIsNew.vue

@@ -81,8 +81,8 @@ export default {
 			news: null
 			news: null
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(true, socket => {
 		io.getSocket(true, socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			_this.socket.emit("news.newest", res => {
 			_this.socket.emit("news.newest", res => {
@@ -108,15 +108,13 @@ export default {
 						}
 						}
 						localStorage.setItem("whatIsNew", res.data.createdAt);
 						localStorage.setItem("whatIsNew", res.data.createdAt);
 					}
 					}
-				} else {
-					if (!localStorage.getItem("firstVisited"))
-						localStorage.setItem("firstVisited", Date.now());
-				}
+				} else if (!localStorage.getItem("firstVisited"))
+					localStorage.setItem("firstVisited", Date.now());
 			});
 			});
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		toggleModal: function() {
+		toggleModal() {
 			this.isModalActive = !this.isModalActive;
 			this.isModalActive = !this.isModalActive;
 		},
 		},
 		formatDate: unix => {
 		formatDate: unix => {
@@ -124,7 +122,7 @@ export default {
 		}
 		}
 	},
 	},
 	events: {
 	events: {
-		closeModal: function() {
+		closeModal() {
 			this.isModalActive = false;
 			this.isModalActive = false;
 		}
 		}
 	}
 	}

+ 9 - 9
frontend/components/Sidebars/Playlist.vue

@@ -58,11 +58,11 @@ export default {
 		};
 		};
 	},
 	},
 	methods: {
 	methods: {
-		edit: function(id) {
+		edit(id) {
 			this.editPlaylist(id);
 			this.editPlaylist(id);
 			this.openModal({ sector: "station", modal: "editPlaylist" });
 			this.openModal({ sector: "station", modal: "editPlaylist" });
 		},
 		},
-		selectPlaylist: function(id) {
+		selectPlaylist(id) {
 			this.socket.emit(
 			this.socket.emit(
 				"stations.selectPrivatePlaylist",
 				"stations.selectPrivatePlaylist",
 				this.$parent.station._id,
 				this.$parent.station._id,
@@ -70,13 +70,13 @@ export default {
 				res => {
 				res => {
 					if (res.status === "failure")
 					if (res.status === "failure")
 						return Toast.methods.addToast(res.message, 8000);
 						return Toast.methods.addToast(res.message, 8000);
-					Toast.methods.addToast(res.message, 4000);
+					return Toast.methods.addToast(res.message, 4000);
 				}
 				}
 			);
 			);
 		},
 		},
-		isNotSelected: function(id) {
-			let _this = this;
-			//TODO Also change this once it changes for a station
+		isNotSelected(id) {
+			const _this = this;
+			// TODO Also change this once it changes for a station
 			if (
 			if (
 				_this.$parent.station &&
 				_this.$parent.station &&
 				_this.$parent.station.privatePlaylist === id
 				_this.$parent.station.privatePlaylist === id
@@ -87,13 +87,13 @@ export default {
 		...mapActions("modals", ["openModal"]),
 		...mapActions("modals", ["openModal"]),
 		...mapActions("user/playlists", ["editPlaylist"])
 		...mapActions("user/playlists", ["editPlaylist"])
 	},
 	},
-	mounted: function() {
+	mounted() {
 		// TODO: Update when playlist is removed/created
 		// TODO: Update when playlist is removed/created
-		let _this = this;
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			_this.socket.emit("playlists.indexForUser", res => {
 			_this.socket.emit("playlists.indexForUser", res => {
-				if (res.status == "success") _this.playlists = res.data;
+				if (res.status === "success") _this.playlists = res.data;
 			});
 			});
 			_this.socket.on("event:playlist.create", playlist => {
 			_this.socket.on("event:playlist.create", playlist => {
 				_this.playlists.push(playlist);
 				_this.playlists.push(playlist);

+ 7 - 7
frontend/components/Sidebars/SongsList.vue

@@ -136,25 +136,25 @@ import { Toast } from "vue-roaster";
 import UserIdToUsername from "../UserIdToUsername.vue";
 import UserIdToUsername from "../UserIdToUsername.vue";
 
 
 export default {
 export default {
-	data: function() {
+	data() {
 		return {
 		return {
 			dismissedWarning: false
 			dismissedWarning: false
 		};
 		};
 	},
 	},
 	methods: {
 	methods: {
-		isOwnerOnly: function() {
+		isOwnerOnly() {
 			return (
 			return (
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.userId === this.$parent.station.owner
 				this.$parent.$parent.userId === this.$parent.station.owner
 			);
 			);
 		},
 		},
-		isAdminOnly: function() {
+		isAdminOnly() {
 			return (
 			return (
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.role === "admin"
 				this.$parent.$parent.role === "admin"
 			);
 			);
 		},
 		},
-		removeFromQueue: function(songId) {
+		removeFromQueue(songId) {
 			window.socket.emit(
 			window.socket.emit(
 				"stations.removeFromQueue",
 				"stations.removeFromQueue",
 				this.$parent.station._id,
 				this.$parent.station._id,
@@ -171,12 +171,12 @@ export default {
 		},
 		},
 		...mapActions("modals", ["openModal"])
 		...mapActions("modals", ["openModal"])
 	},
 	},
-	mounted: function() {
-		/*let _this = this;
+	mounted() {
+		/* let _this = this;
 			io.getSocket((socket) => {
 			io.getSocket((socket) => {
 				_this.socket = socket;
 				_this.socket = socket;
 
 
-			});*/
+			}); */
 	},
 	},
 	components: { UserIdToUsername }
 	components: { UserIdToUsername }
 };
 };

+ 10 - 4
frontend/components/Station/CommunityHeader.vue

@@ -210,12 +210,18 @@ export default {
 			}
 			}
 		};
 		};
 	},
 	},
-	mounted: function() {
-		lofig.get("frontendDomain", res => (this.frontendDomain = res));
-		lofig.get("siteSettings", res => (this.siteSettings = res));
+	mounted() {
+		lofig.get("frontendDomain", res => {
+			this.frontendDomain = res;
+			return res;
+		});
+		lofig.get("siteSettings", res => {
+			this.siteSettings = res;
+			return res;
+		});
 	},
 	},
 	methods: {
 	methods: {
-		isOwner: function() {
+		isOwner() {
 			return (
 			return (
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.loggedIn &&
 				(this.$parent.$parent.role === "admin" ||
 				(this.$parent.$parent.role === "admin" ||

+ 10 - 4
frontend/components/Station/OfficialHeader.vue

@@ -231,12 +231,18 @@ export default {
 			}
 			}
 		};
 		};
 	},
 	},
-	mounted: function() {
-		lofig.get("frontendDomain", res => (this.frontendDomain = res));
-		lofig.get("siteSettings", res => (this.siteSettings = res));
+	mounted() {
+		lofig.get("frontendDomain", res => {
+			this.frontendDomain = res;
+			return res;
+		});
+		lofig.get("siteSettings", res => {
+			this.siteSettings = res;
+			return res;
+		});
 	},
 	},
 	methods: {
 	methods: {
-		isOwner: function() {
+		isOwner() {
 			return (
 			return (
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.role === "admin"
 				this.$parent.$parent.role === "admin"

+ 109 - 101
frontend/components/Station/Station.vue

@@ -485,16 +485,16 @@ export default {
 		})
 		})
 	},
 	},
 	methods: {
 	methods: {
-		isOwnerOnly: function() {
+		isOwnerOnly() {
 			return (
 			return (
 				this.$parent.loggedIn &&
 				this.$parent.loggedIn &&
 				this.$parent.userId === this.station.owner
 				this.$parent.userId === this.station.owner
 			);
 			);
 		},
 		},
-		isAdminOnly: function() {
+		isAdminOnly() {
 			return this.$parent.loggedIn && this.$parent.role === "admin";
 			return this.$parent.loggedIn && this.$parent.role === "admin";
 		},
 		},
-		removeFromQueue: function(songId) {
+		removeFromQueue(songId) {
 			window.socket.emit(
 			window.socket.emit(
 				"stations.removeFromQueue",
 				"stations.removeFromQueue",
 				this.station._id,
 				this.station._id,
@@ -509,14 +509,14 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		toggleSidebar: function(type) {
+		toggleSidebar(type) {
 			Object.keys(this.sidebars).forEach(sidebar => {
 			Object.keys(this.sidebars).forEach(sidebar => {
 				if (sidebar !== type) this.sidebars[sidebar] = false;
 				if (sidebar !== type) this.sidebars[sidebar] = false;
 				else this.sidebars[type] = !this.sidebars[type];
 				else this.sidebars[type] = !this.sidebars[type];
 			});
 			});
 		},
 		},
-		youtubeReady: function() {
-			let local = this;
+		youtubeReady() {
+			const local = this;
 			if (!local.player) {
 			if (!local.player) {
 				local.player = new window.YT.Player("player", {
 				local.player = new window.YT.Player("player", {
 					height: 270,
 					height: 270,
@@ -532,7 +532,7 @@ export default {
 						showinfo: 0
 						showinfo: 0
 					},
 					},
 					events: {
 					events: {
-						onReady: function() {
+						onReady() {
 							local.playerReady = true;
 							local.playerReady = true;
 							let volume = parseInt(
 							let volume = parseInt(
 								localStorage.getItem("volume")
 								localStorage.getItem("volume")
@@ -550,11 +550,11 @@ export default {
 
 
 							local.playVideo();
 							local.playVideo();
 						},
 						},
-						onError: function(err) {
+						onError(err) {
 							console.log("iframe error", err);
 							console.log("iframe error", err);
 							local.voteSkipStation();
 							local.voteSkipStation();
 						},
 						},
-						onStateChange: function(event) {
+						onStateChange(event) {
 							if (
 							if (
 								event.data === 1 &&
 								event.data === 1 &&
 								local.videoLoading === true
 								local.videoLoading === true
@@ -592,17 +592,18 @@ export default {
 				});
 				});
 			}
 			}
 		},
 		},
-		getTimeElapsed: function() {
-			let local = this;
+		getTimeElapsed() {
+			const local = this;
 			if (local.currentSong) {
 			if (local.currentSong) {
-				let timePaused = local.timePaused;
+				let { timePaused } = local;
 				if (local.paused)
 				if (local.paused)
 					timePaused += Date.currently() - local.pausedAt;
 					timePaused += Date.currently() - local.pausedAt;
 				return Date.currently() - local.startedAt - timePaused;
 				return Date.currently() - local.startedAt - timePaused;
-			} else return 0;
+			}
+			return 0;
 		},
 		},
-		playVideo: function() {
-			let local = this;
+		playVideo() {
+			const local = this;
 			if (local.playerReady) {
 			if (local.playerReady) {
 				local.videoLoading = true;
 				local.videoLoading = true;
 				local.player.loadVideoById(
 				local.player.loadVideoById(
@@ -619,33 +620,34 @@ export default {
 				}, 150);
 				}, 150);
 			}
 			}
 		},
 		},
-		resizeSeekerbar: function() {
-			let local = this;
+		resizeSeekerbar() {
+			const local = this;
 			if (!local.paused) {
 			if (!local.paused) {
-				document.getElementsByClassName("seeker-bar")[0].style.width =
-					parseFloat(
-						(local.getTimeElapsed() /
-							1000 /
-							local.currentSong.duration) *
-							100
-					) + "%";
+				document.getElementsByClassName(
+					"seeker-bar"
+				)[0].style.width = `${parseFloat(
+					(local.getTimeElapsed() /
+						1000 /
+						local.currentSong.duration) *
+						100
+				)}%`;
 			}
 			}
 		},
 		},
-		formatTime: function(duration) {
-			let d = moment.duration(duration, "seconds");
+		formatTime(duration) {
+			const d = moment.duration(duration, "seconds");
 			if (duration < 0) return "0:00";
 			if (duration < 0) return "0:00";
-			return (
-				(d.hours() > 0
+			return `${
+				d.hours() > 0
 					? d.hours() < 10
 					? d.hours() < 10
-						? "0" + d.hours() + ":"
-						: d.hours() + ":"
-					: "") +
-				(d.minutes() + ":") +
-				(d.seconds() < 10 ? "0" + d.seconds() : d.seconds())
-			);
+						? `0${d.hours()}:`
+						: `${d.hours()}:`
+					: ""
+			}${d.minutes()}:${
+				d.seconds() < 10 ? `0${d.seconds()}` : d.seconds()
+			}`;
 		},
 		},
-		calculateTimeElapsed: function() {
-			let local = this;
+		calculateTimeElapsed() {
+			const local = this;
 
 
 			if (
 			if (
 				local.playerReady &&
 				local.playerReady &&
@@ -669,57 +671,57 @@ export default {
 					}
 					}
 				} else {
 				} else {
 					local.player.playVideo();
 					local.player.playVideo();
-					local.attemptsToPlayVideo++;
+					local.attemptsToPlayVideo += 1;
 				}
 				}
 			}
 			}
 
 
 			if (!local.paused) {
 			if (!local.paused) {
-				let timeElapsed = local.getTimeElapsed();
-				let currentPlayerTime = local.player.getCurrentTime() * 1000;
+				const timeElapsed = local.getTimeElapsed();
+				const currentPlayerTime = local.player.getCurrentTime() * 1000;
 
 
-				let difference = timeElapsed - currentPlayerTime;
-				//console.log(difference123);
+				const difference = timeElapsed - currentPlayerTime;
+				// console.log(difference123);
 				if (difference < -200) {
 				if (difference < -200) {
-					//console.log("Difference0.8");
+					// console.log("Difference0.8");
 					local.player.setPlaybackRate(0.8);
 					local.player.setPlaybackRate(0.8);
 				} else if (difference < -50) {
 				} else if (difference < -50) {
-					//console.log("Difference0.9");
+					// console.log("Difference0.9");
 					local.player.setPlaybackRate(0.9);
 					local.player.setPlaybackRate(0.9);
 				} else if (difference < -25) {
 				} else if (difference < -25) {
-					//console.log("Difference0.99");
+					// console.log("Difference0.99");
 					local.player.setPlaybackRate(0.99);
 					local.player.setPlaybackRate(0.99);
 				} else if (difference > 200) {
 				} else if (difference > 200) {
-					//console.log("Difference1.2");
+					// console.log("Difference1.2");
 					local.player.setPlaybackRate(1.2);
 					local.player.setPlaybackRate(1.2);
 				} else if (difference > 50) {
 				} else if (difference > 50) {
-					//console.log("Difference1.1");
+					// console.log("Difference1.1");
 					local.player.setPlaybackRate(1.1);
 					local.player.setPlaybackRate(1.1);
 				} else if (difference > 25) {
 				} else if (difference > 25) {
-					//console.log("Difference1.01");
+					// console.log("Difference1.01");
 					local.player.setPlaybackRate(1.01);
 					local.player.setPlaybackRate(1.01);
 				} else if (local.player.getPlaybackRate !== 1.0) {
 				} else if (local.player.getPlaybackRate !== 1.0) {
-					//console.log("NDifference1.0");
+					// console.log("NDifference1.0");
 					local.player.setPlaybackRate(1.0);
 					local.player.setPlaybackRate(1.0);
 				}
 				}
 			}
 			}
 
 
-			/*if (local.currentTime !== undefined && local.paused) {
+			/* if (local.currentTime !== undefined && local.paused) {
 				local.timePaused += Date.currently() - local.currentTime;
 				local.timePaused += Date.currently() - local.currentTime;
 				local.currentTime = undefined;
 				local.currentTime = undefined;
-			}*/
+			} */
 
 
-			let timePaused = local.timePaused;
+			let { timePaused } = local;
 			if (local.paused) timePaused += Date.currently() - local.pausedAt;
 			if (local.paused) timePaused += Date.currently() - local.pausedAt;
 
 
-			let duration =
+			const duration =
 				(Date.currently() - local.startedAt - timePaused) / 1000;
 				(Date.currently() - local.startedAt - timePaused) / 1000;
 
 
-			let songDuration = local.currentSong.duration;
+			const songDuration = local.currentSong.duration;
 			if (songDuration <= duration) local.player.pauseVideo();
 			if (songDuration <= duration) local.player.pauseVideo();
 			if (!local.paused && duration <= songDuration)
 			if (!local.paused && duration <= songDuration)
 				local.timeElapsed = local.formatTime(duration);
 				local.timeElapsed = local.formatTime(duration);
 		},
 		},
-		toggleLock: function() {
+		toggleLock() {
 			window.socket.emit("stations.toggleLock", this.station._id, res => {
 			window.socket.emit("stations.toggleLock", this.station._id, res => {
 				if (res.status === "success") {
 				if (res.status === "success") {
 					Toast.methods.addToast(
 					Toast.methods.addToast(
@@ -729,9 +731,9 @@ export default {
 				} else Toast.methods.addToast(res.message, 8000);
 				} else Toast.methods.addToast(res.message, 8000);
 			});
 			});
 		},
 		},
-		changeVolume: function() {
-			let local = this;
-			let volume = document.getElementById("volumeSlider").value;
+		changeVolume() {
+			const local = this;
+			const volume = document.getElementById("volumeSlider").value;
 			localStorage.setItem("volume", volume / 100);
 			localStorage.setItem("volume", volume / 100);
 			if (local.playerReady) {
 			if (local.playerReady) {
 				local.player.setVolume(volume / 100);
 				local.player.setVolume(volume / 100);
@@ -742,7 +744,7 @@ export default {
 				}
 				}
 			}
 			}
 		},
 		},
-		resumeLocalStation: function() {
+		resumeLocalStation() {
 			this.paused = false;
 			this.paused = false;
 			if (!this.noSong) {
 			if (!this.noSong) {
 				if (this.playerReady) {
 				if (this.playerReady) {
@@ -754,15 +756,15 @@ export default {
 				}
 				}
 			}
 			}
 		},
 		},
-		pauseLocalStation: function() {
+		pauseLocalStation() {
 			this.paused = true;
 			this.paused = true;
 			if (!this.noSong) {
 			if (!this.noSong) {
 				this.timeBeforePause = this.getTimeElapsed();
 				this.timeBeforePause = this.getTimeElapsed();
 				if (this.playerReady) this.player.pauseVideo();
 				if (this.playerReady) this.player.pauseVideo();
 			}
 			}
 		},
 		},
-		skipStation: function() {
-			let _this = this;
+		skipStation() {
+			const _this = this;
 			_this.socket.emit("stations.forceSkip", _this.station._id, data => {
 			_this.socket.emit("stations.forceSkip", _this.station._id, data => {
 				if (data.status !== "success")
 				if (data.status !== "success")
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
@@ -773,8 +775,8 @@ export default {
 					);
 					);
 			});
 			});
 		},
 		},
-		voteSkipStation: function() {
-			let _this = this;
+		voteSkipStation() {
+			const _this = this;
 			_this.socket.emit("stations.voteSkip", _this.station._id, data => {
 			_this.socket.emit("stations.voteSkip", _this.station._id, data => {
 				if (data.status !== "success")
 				if (data.status !== "success")
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
@@ -785,8 +787,8 @@ export default {
 					);
 					);
 			});
 			});
 		},
 		},
-		resumeStation: function() {
-			let _this = this;
+		resumeStation() {
+			const _this = this;
 			_this.socket.emit("stations.resume", _this.station._id, data => {
 			_this.socket.emit("stations.resume", _this.station._id, data => {
 				if (data.status !== "success")
 				if (data.status !== "success")
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
@@ -797,8 +799,8 @@ export default {
 					);
 					);
 			});
 			});
 		},
 		},
-		pauseStation: function() {
-			let _this = this;
+		pauseStation() {
+			const _this = this;
 			_this.socket.emit("stations.pause", _this.station._id, data => {
 			_this.socket.emit("stations.pause", _this.station._id, data => {
 				if (data.status !== "success")
 				if (data.status !== "success")
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
@@ -809,10 +811,12 @@ export default {
 					);
 					);
 			});
 			});
 		},
 		},
-		toggleMute: function() {
+		toggleMute() {
 			if (this.playerReady) {
 			if (this.playerReady) {
-				let previousVolume = parseFloat(localStorage.getItem("volume"));
-				let volume =
+				const previousVolume = parseFloat(
+					localStorage.getItem("volume")
+				);
+				const volume =
 					this.player.getVolume() * 100 <= 0 ? previousVolume : 0;
 					this.player.getVolume() * 100 <= 0 ? previousVolume : 0;
 				this.muted = !this.muted;
 				this.muted = !this.muted;
 				localStorage.setItem("muted", this.muted);
 				localStorage.setItem("muted", this.muted);
@@ -821,9 +825,9 @@ export default {
 				if (!this.muted) localStorage.setItem("volume", volume);
 				if (!this.muted) localStorage.setItem("volume", volume);
 			}
 			}
 		},
 		},
-		increaseVolume: function() {
+		increaseVolume() {
 			if (this.playerReady) {
 			if (this.playerReady) {
-				let previousVolume = parseInt(localStorage.getItem("volume"));
+				const previousVolume = parseInt(localStorage.getItem("volume"));
 				let volume = previousVolume + 5;
 				let volume = previousVolume + 5;
 				if (previousVolume === 0) {
 				if (previousVolume === 0) {
 					this.muted = false;
 					this.muted = false;
@@ -835,8 +839,8 @@ export default {
 				localStorage.setItem("volume", volume);
 				localStorage.setItem("volume", volume);
 			}
 			}
 		},
 		},
-		toggleLike: function() {
-			let _this = this;
+		toggleLike() {
+			const _this = this;
 			if (_this.liked)
 			if (_this.liked)
 				_this.socket.emit(
 				_this.socket.emit(
 					"songs.unlike",
 					"songs.unlike",
@@ -862,8 +866,8 @@ export default {
 					}
 					}
 				);
 				);
 		},
 		},
-		toggleDislike: function() {
-			let _this = this;
+		toggleDislike() {
+			const _this = this;
 			if (_this.disliked)
 			if (_this.disliked)
 				return _this.socket.emit(
 				return _this.socket.emit(
 					"songs.undislike",
 					"songs.undislike",
@@ -876,7 +880,8 @@ export default {
 							);
 							);
 					}
 					}
 				);
 				);
-			_this.socket.emit(
+
+			return _this.socket.emit(
 				"songs.dislike",
 				"songs.dislike",
 				_this.currentSong.songId,
 				_this.currentSong.songId,
 				data => {
 				data => {
@@ -885,10 +890,10 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		addFirstPrivatePlaylistSongToQueue: function() {
-			let _this = this;
+		addFirstPrivatePlaylistSongToQueue() {
+			const _this = this;
 			let isInQueue = false;
 			let isInQueue = false;
-			let userId = _this.$parent.userId;
+			const { userId } = _this.$parent;
 			if (_this.type === "community") {
 			if (_this.type === "community") {
 				_this.songsList.forEach(queueSong => {
 				_this.songsList.forEach(queueSong => {
 					if (queueSong.requestedBy === userId) isInQueue = true;
 					if (queueSong.requestedBy === userId) isInQueue = true;
@@ -946,8 +951,8 @@ export default {
 				}
 				}
 			}
 			}
 		},
 		},
-		join: function() {
-			let _this = this;
+		join() {
+			const _this = this;
 			_this.socket.emit("stations.join", _this.stationName, res => {
 			_this.socket.emit("stations.join", _this.stationName, res => {
 				if (res.status === "success") {
 				if (res.status === "success") {
 					_this.loading = false;
 					_this.loading = false;
@@ -1015,17 +1020,17 @@ export default {
 						_this.noSong = true;
 						_this.noSong = true;
 					}
 					}
 					// UNIX client time before ping
 					// UNIX client time before ping
-					let beforePing = Date.now();
-					_this.socket.emit("apis.ping", res => {
+					const beforePing = Date.now();
+					_this.socket.emit("apis.ping", pong => {
 						// UNIX client time after ping
 						// UNIX client time after ping
-						let afterPing = Date.now();
+						const afterPing = Date.now();
 						// Average time in MS it took between the server responding and the client receiving
 						// Average time in MS it took between the server responding and the client receiving
-						let connectionLatency = (afterPing - beforePing) / 2;
+						const connectionLatency = (afterPing - beforePing) / 2;
 						console.log(connectionLatency, beforePing - afterPing);
 						console.log(connectionLatency, beforePing - afterPing);
 						// UNIX server time
 						// UNIX server time
-						let serverDate = res.date;
+						const serverDate = pong.date;
 						// Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
 						// Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
-						let difference =
+						const difference =
 							serverDate + connectionLatency - afterPing;
 							serverDate + connectionLatency - afterPing;
 						console.log("Difference: ", difference);
 						console.log("Difference: ", difference);
 						if (difference > 3000 || difference < -3000) {
 						if (difference > 3000 || difference < -3000) {
@@ -1041,8 +1046,8 @@ export default {
 		...mapActions("modals", ["openModal"]),
 		...mapActions("modals", ["openModal"]),
 		...mapActions("station", ["joinStation"])
 		...mapActions("station", ["joinStation"])
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 
 
 		Date.currently = () => {
 		Date.currently = () => {
 			return new Date().getTime() + _this.systemDifference;
 			return new Date().getTime() + _this.systemDifference;
@@ -1089,10 +1094,10 @@ export default {
 					_this.socket.emit(
 					_this.socket.emit(
 						"songs.getOwnSongRatings",
 						"songs.getOwnSongRatings",
 						data.currentSong.songId,
 						data.currentSong.songId,
-						data => {
-							if (_this.currentSong.songId === data.songId) {
-								_this.liked = data.liked;
-								_this.disliked = data.disliked;
+						song => {
+							if (_this.currentSong.songId === song.songId) {
+								_this.liked = song.liked;
+								_this.disliked = song.disliked;
 							}
 							}
 						}
 						}
 					);
 					);
@@ -1102,7 +1107,7 @@ export default {
 				}
 				}
 
 
 				let isInQueue = false;
 				let isInQueue = false;
-				let userId = _this.$parent.userId;
+				const { userId } = _this.$parent;
 				_this.songsList.forEach(queueSong => {
 				_this.songsList.forEach(queueSong => {
 					if (queueSong.requestedBy === userId) isInQueue = true;
 					if (queueSong.requestedBy === userId) isInQueue = true;
 				});
 				});
@@ -1127,10 +1132,10 @@ export default {
 				_this.resumeLocalStation();
 				_this.resumeLocalStation();
 			});
 			});
 
 
-			_this.socket.on(
-				"event:stations.remove",
-				() => (location.href = "/")
-			);
+			_this.socket.on("event:stations.remove", () => {
+				window.location.href = "/";
+				return true;
+			});
 
 
 			_this.socket.on("event:song.like", data => {
 			_this.socket.on("event:song.like", data => {
 				if (!this.noSong) {
 				if (!this.noSong) {
@@ -1182,7 +1187,7 @@ export default {
 			});
 			});
 
 
 			_this.socket.on("event:song.voteSkipSong", () => {
 			_this.socket.on("event:song.voteSkipSong", () => {
-				if (this.currentSong) this.currentSong.skipVotes++;
+				if (this.currentSong) this.currentSong.skipVotes += 1;
 			});
 			});
 
 
 			_this.socket.on("event:privatePlaylist.selected", playlistId => {
 			_this.socket.on("event:privatePlaylist.selected", playlistId => {
@@ -1222,7 +1227,10 @@ export default {
 			document.getElementById("volumeSlider").value = 0 * 100;
 			document.getElementById("volumeSlider").value = 0 * 100;
 		} else {
 		} else {
 			let volume = parseFloat(localStorage.getItem("volume"));
 			let volume = parseFloat(localStorage.getItem("volume"));
-			volume = typeof volume === "number" && !isNaN(volume) ? volume : 20;
+			volume =
+				typeof volume === "number" && !Number.isNaN(volume)
+					? volume
+					: 20;
 			localStorage.setItem("volume", volume);
 			localStorage.setItem("volume", volume);
 			document.getElementById("volumeSlider").value = volume * 100;
 			document.getElementById("volumeSlider").value = volume * 100;
 		}
 		}

+ 16 - 12
frontend/components/User/ResetPassword.vue

@@ -85,27 +85,31 @@ export default {
 			step: 1
 			step: 1
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		submitEmail: function() {
+		submitEmail() {
 			if (!this.email)
 			if (!this.email)
 				return Toast.methods.addToast("Email cannot be empty", 8000);
 				return Toast.methods.addToast("Email cannot be empty", 8000);
-			this.socket.emit("users.requestPasswordReset", this.email, res => {
-				Toast.methods.addToast(res.message, 8000);
-				if (res.status === "success") {
-					this.step = 2;
+			return this.socket.emit(
+				"users.requestPasswordReset",
+				this.email,
+				res => {
+					Toast.methods.addToast(res.message, 8000);
+					if (res.status === "success") {
+						this.step = 2;
+					}
 				}
 				}
-			});
+			);
 		},
 		},
-		verifyCode: function() {
+		verifyCode() {
 			if (!this.code)
 			if (!this.code)
 				return Toast.methods.addToast("Code cannot be empty", 8000);
 				return Toast.methods.addToast("Code cannot be empty", 8000);
-			this.socket.emit(
+			return this.socket.emit(
 				"users.verifyPasswordResetCode",
 				"users.verifyPasswordResetCode",
 				this.code,
 				this.code,
 				res => {
 				res => {
@@ -116,10 +120,10 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		changePassword: function() {
+		changePassword() {
 			if (!this.newPassword)
 			if (!this.newPassword)
 				return Toast.methods.addToast("Password cannot be empty", 8000);
 				return Toast.methods.addToast("Password cannot be empty", 8000);
-			this.socket.emit(
+			return this.socket.emit(
 				"users.changePasswordWithResetCode",
 				"users.changePasswordWithResetCode",
 				this.code,
 				this.code,
 				this.newPassword,
 				this.newPassword,

+ 32 - 28
frontend/components/User/Settings.vue

@@ -167,12 +167,12 @@ export default {
 			passwordCode: ""
 			passwordCode: ""
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			_this.socket.emit("users.findBySession", res => {
 			_this.socket.emit("users.findBySession", res => {
-				if (res.status == "success") {
+				if (res.status === "success") {
 					_this.user = res.data;
 					_this.user = res.data;
 					_this.password = _this.user.password;
 					_this.password = _this.user.password;
 					_this.github = _this.user.github;
 					_this.github = _this.user.github;
@@ -202,7 +202,7 @@ export default {
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		changeEmail: function() {
+		changeEmail() {
 			const email = this.user.email.address;
 			const email = this.user.email.address;
 			if (!validation.isLength(email, 3, 254))
 			if (!validation.isLength(email, 3, 254))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
@@ -215,7 +215,7 @@ export default {
 			)
 			)
 				return Toast.methods.addToast("Invalid email format.", 8000);
 				return Toast.methods.addToast("Invalid email format.", 8000);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"users.updateEmail",
 				"users.updateEmail",
 				this.$parent.userId,
 				this.$parent.userId,
 				email,
 				email,
@@ -230,8 +230,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		changeUsername: function() {
-			const username = this.user.username;
+		changeUsername() {
+			const { username } = this.user;
 			if (!validation.isLength(username, 2, 32))
 			if (!validation.isLength(username, 2, 32))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Username must have between 2 and 32 characters.",
 					"Username must have between 2 and 32 characters.",
@@ -243,7 +243,7 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"users.updateUsername",
 				"users.updateUsername",
 				this.$parent.userId,
 				this.$parent.userId,
 				username,
 				username,
@@ -258,8 +258,8 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		changePassword: function() {
-			const newPassword = this.newPassword;
+		changePassword() {
+			const { newPassword } = this;
 			if (!validation.isLength(newPassword, 6, 200))
 			if (!validation.isLength(newPassword, 6, 200))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
 					"Password must have between 6 and 200 characters.",
 					"Password must have between 6 and 200 characters.",
@@ -271,28 +271,32 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit("users.updatePassword", newPassword, res => {
-				if (res.status !== "success")
-					Toast.methods.addToast(res.message, 8000);
-				else
-					Toast.methods.addToast(
-						"Successfully changed password",
-						4000
-					);
-			});
+			return this.socket.emit(
+				"users.updatePassword",
+				newPassword,
+				res => {
+					if (res.status !== "success")
+						Toast.methods.addToast(res.message, 8000);
+					else
+						Toast.methods.addToast(
+							"Successfully changed password",
+							4000
+						);
+				}
+			);
 		},
 		},
-		requestPassword: function() {
-			this.socket.emit("users.requestPassword", res => {
+		requestPassword() {
+			return this.socket.emit("users.requestPassword", res => {
 				Toast.methods.addToast(res.message, 8000);
 				Toast.methods.addToast(res.message, 8000);
 				if (res.status === "success") {
 				if (res.status === "success") {
 					this.passwordStep = 2;
 					this.passwordStep = 2;
 				}
 				}
 			});
 			});
 		},
 		},
-		verifyCode: function() {
+		verifyCode() {
 			if (!this.passwordCode)
 			if (!this.passwordCode)
 				return Toast.methods.addToast("Code cannot be empty", 8000);
 				return Toast.methods.addToast("Code cannot be empty", 8000);
-			this.socket.emit(
+			return this.socket.emit(
 				"users.verifyPasswordCode",
 				"users.verifyPasswordCode",
 				this.passwordCode,
 				this.passwordCode,
 				res => {
 				res => {
@@ -303,7 +307,7 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		setPassword: function() {
+		setPassword() {
 			const newPassword = this.setNewPassword;
 			const newPassword = this.setNewPassword;
 			if (!validation.isLength(newPassword, 6, 200))
 			if (!validation.isLength(newPassword, 6, 200))
 				return Toast.methods.addToast(
 				return Toast.methods.addToast(
@@ -316,7 +320,7 @@ export default {
 					8000
 					8000
 				);
 				);
 
 
-			this.socket.emit(
+			return this.socket.emit(
 				"users.changePasswordWithCode",
 				"users.changePasswordWithCode",
 				this.passwordCode,
 				this.passwordCode,
 				newPassword,
 				newPassword,
@@ -325,17 +329,17 @@ export default {
 				}
 				}
 			);
 			);
 		},
 		},
-		unlinkPassword: function() {
+		unlinkPassword() {
 			this.socket.emit("users.unlinkPassword", res => {
 			this.socket.emit("users.unlinkPassword", res => {
 				Toast.methods.addToast(res.message, 8000);
 				Toast.methods.addToast(res.message, 8000);
 			});
 			});
 		},
 		},
-		unlinkGitHub: function() {
+		unlinkGitHub() {
 			this.socket.emit("users.unlinkGitHub", res => {
 			this.socket.emit("users.unlinkGitHub", res => {
 				Toast.methods.addToast(res.message, 8000);
 				Toast.methods.addToast(res.message, 8000);
 			});
 			});
 		},
 		},
-		removeSessions: function() {
+		removeSessions() {
 			this.socket.emit(
 			this.socket.emit(
 				`users.removeSessions`,
 				`users.removeSessions`,
 				this.$parent.userId,
 				this.$parent.userId,

+ 5 - 5
frontend/components/User/Show.vue

@@ -78,15 +78,15 @@ export default {
 			isUser: false
 			isUser: false
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			_this.socket.emit(
 			_this.socket.emit(
 				"users.findByUsername",
 				"users.findByUsername",
 				_this.$route.params.username,
 				_this.$route.params.username,
 				res => {
 				res => {
-					if (res.status == "error") this.$router.go("/404");
+					if (res.status === "error") this.$router.go("/404");
 					else {
 					else {
 						_this.user = res.data;
 						_this.user = res.data;
 						this.user.createdAt = moment(
 						this.user.createdAt = moment(
@@ -103,9 +103,9 @@ export default {
 			this.socket.emit(
 			this.socket.emit(
 				"users.updateRole",
 				"users.updateRole",
 				this.user._id,
 				this.user._id,
-				newRank == "admin" ? "admin" : "default",
+				newRank === "admin" ? "admin" : "default",
 				res => {
 				res => {
-					if (res.status == "error")
+					if (res.status === "error")
 						Toast.methods.addToast(res.message, 2000);
 						Toast.methods.addToast(res.message, 2000);
 					else this.user.role = newRank;
 					else this.user.role = newRank;
 					Toast.methods.addToast(
 					Toast.methods.addToast(

+ 2 - 2
frontend/components/UserIdToUsername.vue

@@ -15,7 +15,7 @@ import { mapState, mapActions } from "vuex";
 
 
 export default {
 export default {
 	props: ["userId", "link"],
 	props: ["userId", "link"],
-	data: function() {
+	data() {
 		return {
 		return {
 			username: ""
 			username: ""
 		};
 		};
@@ -28,7 +28,7 @@ export default {
 	methods: {
 	methods: {
 		...mapActions("user/auth", ["getUsernameFromId"])
 		...mapActions("user/auth", ["getUsernameFromId"])
 	},
 	},
-	mounted: function() {
+	mounted() {
 		this.getUsernameFromId(this.$props.userId).then(res => {
 		this.getUsernameFromId(this.$props.userId).then(res => {
 			this.username = res;
 			this.username = res;
 		});
 		});

+ 1 - 1
frontend/components/pages/About.vue

@@ -71,7 +71,7 @@ export default {
 	data() {
 	data() {
 		return {};
 		return {};
 	},
 	},
-	mounted: function() {},
+	mounted() {},
 	methods: {}
 	methods: {}
 };
 };
 </script>
 </script>

+ 2 - 2
frontend/components/pages/Admin.vue

@@ -130,7 +130,7 @@ export default {
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
-		changeTab: function(path) {
+		changeTab(path) {
 			switch (path) {
 			switch (path) {
 				case "/admin/queuesongs":
 				case "/admin/queuesongs":
 					this.currentTab = "queueSongs";
 					this.currentTab = "queueSongs";
@@ -160,7 +160,7 @@ export default {
 					this.currentTab = "queueSongs";
 					this.currentTab = "queueSongs";
 			}
 			}
 		},
 		},
-		showTab: function(tab) {
+		showTab(tab) {
 			this.currentTab = tab;
 			this.currentTab = tab;
 		}
 		}
 	}
 	}

+ 45 - 42
frontend/components/pages/Home.vue

@@ -174,7 +174,7 @@ export default {
 		modals: state => state.modals.home
 		modals: state => state.modals.home
 	}),
 	}),
 	mounted() {
 	mounted() {
-		let _this = this;
+		const _this = this;
 		auth.getStatus(() => {
 		auth.getStatus(() => {
 			io.getSocket(socket => {
 			io.getSocket(socket => {
 				_this.socket = socket;
 				_this.socket = socket;
@@ -182,7 +182,9 @@ export default {
 				io.onConnect(() => {
 				io.onConnect(() => {
 					_this.init();
 					_this.init();
 				});
 				});
-				_this.socket.on("event:stations.created", station => {
+				_this.socket.on("event:stations.created", res => {
+					const station = res;
+
 					if (!station.currentSong)
 					if (!station.currentSong)
 						station.currentSong = {
 						station.currentSong = {
 							thumbnail: "/assets/notes-transparent.png"
 							thumbnail: "/assets/notes-transparent.png"
@@ -195,63 +197,64 @@ export default {
 				_this.socket.on(
 				_this.socket.on(
 					"event:userCount.updated",
 					"event:userCount.updated",
 					(stationId, userCount) => {
 					(stationId, userCount) => {
-						_this.stations.official.forEach(station => {
+						_this.stations.official.forEach(s => {
+							const station = s;
 							if (station._id === stationId) {
 							if (station._id === stationId) {
 								station.userCount = userCount;
 								station.userCount = userCount;
 							}
 							}
 						});
 						});
 
 
-						_this.stations.community.forEach(station => {
+						_this.stations.community.forEach(s => {
+							const station = s;
 							if (station._id === stationId) {
 							if (station._id === stationId) {
 								station.userCount = userCount;
 								station.userCount = userCount;
 							}
 							}
 						});
 						});
 					}
 					}
 				);
 				);
-				_this.socket.on(
-					"event:station.nextSong",
-					(stationId, newSong) => {
-						_this.stations.official.forEach(station => {
-							if (station._id === stationId) {
-								if (!newSong)
-									newSong = {
-										thumbnail:
-											"/assets/notes-transparent.png"
-									};
-								if (newSong && !newSong.thumbnail)
-									newSong.thumbnail =
-										"/assets/notes-transparent.png";
-								station.currentSong = newSong;
-							}
-						});
-
-						_this.stations.community.forEach(station => {
-							if (station._id === stationId) {
-								if (!newSong)
-									newSong = {
-										thumbnail:
-											"/assets/notes-transparent.png"
-									};
-								if (newSong && !newSong.thumbnail)
-									newSong.thumbnail =
-										"/assets/notes-transparent.png";
-								station.currentSong = newSong;
-							}
-						});
-					}
-				);
+				_this.socket.on("event:station.nextSong", (stationId, song) => {
+					let newSong = song;
+					_this.stations.official.forEach(s => {
+						const station = s;
+						if (station._id === stationId) {
+							if (!newSong)
+								newSong = {
+									thumbnail: "/assets/notes-transparent.png"
+								};
+							if (newSong && !newSong.thumbnail)
+								newSong.thumbnail =
+									"/assets/notes-transparent.png";
+							station.currentSong = newSong;
+						}
+					});
+
+					_this.stations.community.forEach(s => {
+						const station = s;
+						if (station._id === stationId) {
+							if (!newSong)
+								newSong = {
+									thumbnail: "/assets/notes-transparent.png"
+								};
+							if (newSong && !newSong.thumbnail)
+								newSong.thumbnail =
+									"/assets/notes-transparent.png";
+							station.currentSong = newSong;
+						}
+					});
+				});
 			});
 			});
 		});
 		});
 	},
 	},
 	methods: {
 	methods: {
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			auth.getStatus((authenticated, role, username, userId) => {
 			auth.getStatus((authenticated, role, username, userId) => {
 				_this.socket.emit("stations.index", data => {
 				_this.socket.emit("stations.index", data => {
 					_this.stations.community = [];
 					_this.stations.community = [];
 					_this.stations.official = [];
 					_this.stations.official = [];
 					if (data.status === "success")
 					if (data.status === "success")
-						data.stations.forEach(station => {
+						data.stations.forEach(s => {
+							const station = s;
 							if (!station.currentSong)
 							if (!station.currentSong)
 								station.currentSong = {
 								station.currentSong = {
 									thumbnail: "/assets/notes-transparent.png"
 									thumbnail: "/assets/notes-transparent.png"
@@ -269,7 +272,7 @@ export default {
 								station.owner === userId
 								station.owner === userId
 							)
 							)
 								station.class = { "station-blue": true };
 								station.class = { "station-blue": true };
-							if (station.type == "official")
+							if (station.type === "official")
 								_this.stations.official.push(station);
 								_this.stations.official.push(station);
 							else _this.stations.community.push(station);
 							else _this.stations.community.push(station);
 						});
 						});
@@ -277,8 +280,8 @@ export default {
 				_this.socket.emit("apis.joinRoom", "home", () => {});
 				_this.socket.emit("apis.joinRoom", "home", () => {});
 			});
 			});
 		},
 		},
-		isOwner: function(station) {
-			let _this = this;
+		isOwner(station) {
+			const _this = this;
 			return (
 			return (
 				station.owner === _this.$parent.userId &&
 				station.owner === _this.$parent.userId &&
 				station.privacy === "public"
 				station.privacy === "public"

+ 3 - 3
frontend/components/pages/News.vue

@@ -89,8 +89,8 @@ export default {
 			noFound: false
 			noFound: false
 		};
 		};
 	},
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket = socket;
 			_this.socket.emit("news.index", res => {
 			_this.socket.emit("news.index", res => {
@@ -102,7 +102,7 @@ export default {
 				_this.noFound = false;
 				_this.noFound = false;
 			});
 			});
 			_this.socket.on("event:admin.news.updated", news => {
 			_this.socket.on("event:admin.news.updated", news => {
-				for (let n = 0; n < _this.news.length; n++) {
+				for (let n = 0; n < _this.news.length; n += 1) {
 					if (_this.news[n]._id === news._id) {
 					if (_this.news[n]._id === news._id) {
 						_this.news.$set(n, news);
 						_this.news.$set(n, news);
 					}
 					}

+ 23 - 25
frontend/io.js

@@ -3,40 +3,38 @@ let callbacksPersist = [];
 let onConnectCallbacks = [];
 let onConnectCallbacks = [];
 let onDisconnectCallbacks = [];
 let onDisconnectCallbacks = [];
 let onConnectErrorCallbacks = [];
 let onConnectErrorCallbacks = [];
-let onConnectCallbacksPersist = [];
-let onDisconnectCallbacksPersist = [];
-let onConnectErrorCallbacksPersist = [];
+const onConnectCallbacksPersist = [];
+const onDisconnectCallbacksPersist = [];
+const onConnectErrorCallbacksPersist = [];
 
 
 export default {
 export default {
 	ready: false,
 	ready: false,
 	socket: null,
 	socket: null,
 
 
-	getSocket: function() {
-		if (arguments[0] === true) {
-			if (this.ready) arguments[1](this.socket);
-			else callbacksPersist.push(arguments[1]);
-		} else {
-			if (this.ready) arguments[0](this.socket);
-			else callbacks.push(arguments[0]);
-		}
+	getSocket(...args) {
+		if (args[0] === true) {
+			if (this.ready) args[1](this.socket);
+			else callbacksPersist.push(args[1]);
+		} else if (this.ready) args[0](this.socket);
+		else callbacks.push(args[0]);
 	},
 	},
 
 
-	onConnect: function() {
-		if (arguments[0] === true) {
-			onConnectCallbacksPersist.push(arguments[1]);
-		} else onConnectCallbacks.push(arguments[0]);
+	onConnect(...args) {
+		if (args[0] === true) {
+			onConnectCallbacksPersist.push(args[1]);
+		} else onConnectCallbacks.push(args[0]);
 	},
 	},
 
 
-	onDisconnect: function() {
-		if (arguments[0] === true) {
-			onDisconnectCallbacksPersist.push(arguments[1]);
-		} else onDisconnectCallbacks.push(arguments[0]);
+	onDisconnect(...args) {
+		if (args[0] === true) {
+			onDisconnectCallbacksPersist.push(args[1]);
+		} else onDisconnectCallbacks.push(args[0]);
 	},
 	},
 
 
-	onConnectError: function() {
-		if (arguments[0] === true) {
-			onConnectErrorCallbacksPersist.push(arguments[1]);
-		} else onConnectErrorCallbacks.push(arguments[0]);
+	onConnectError(...args) {
+		if (args[0] === true) {
+			onConnectErrorCallbacksPersist.push(args[1]);
+		} else onConnectErrorCallbacks.push(args[0]);
 	},
 	},
 
 
 	clear: () => {
 	clear: () => {
@@ -46,7 +44,7 @@ export default {
 		callbacks = [];
 		callbacks = [];
 	},
 	},
 
 
-	removeAllListeners: function() {
+	removeAllListeners() {
 		Object.keys(this.socket._callbacks).forEach(id => {
 		Object.keys(this.socket._callbacks).forEach(id => {
 			if (
 			if (
 				id.indexOf("$event:") !== -1 &&
 				id.indexOf("$event:") !== -1 &&
@@ -57,7 +55,7 @@ export default {
 		});
 		});
 	},
 	},
 
 
-	init: function(url) {
+	init(url) {
 		/* eslint-disable-next-line no-undef */
 		/* eslint-disable-next-line no-undef */
 		this.socket = window.socket = io(url);
 		this.socket = window.socket = io(url);
 		this.socket.on("connect", () => {
 		this.socket.on("connect", () => {

+ 3 - 2
frontend/main.js

@@ -9,7 +9,7 @@ import io from "./io";
 
 
 Vue.use(VueRouter);
 Vue.use(VueRouter);
 
 
-let router = new VueRouter({
+const router = new VueRouter({
 	mode: "history",
 	mode: "history",
 	routes: [
 	routes: [
 		{
 		{
@@ -93,7 +93,7 @@ let router = new VueRouter({
 });
 });
 
 
 lofig.folder = "../config/default.json";
 lofig.folder = "../config/default.json";
-lofig.get("serverDomain", function(res) {
+lofig.get("serverDomain", res => {
 	io.init(res);
 	io.init(res);
 	io.getSocket(socket => {
 	io.getSocket(socket => {
 		socket.on("ready", (status, role, username, userId) => {
 		socket.on("ready", (status, role, username, userId) => {
@@ -154,6 +154,7 @@ router.afterEach(to => {
 	ga("send", "pageview");
 	ga("send", "pageview");
 });
 });
 
 
+// eslint-disable-next-line no-new
 new Vue({
 new Vue({
 	router,
 	router,
 	store,
 	store,

+ 2 - 0
frontend/store/modules/admin.js

@@ -1,3 +1,5 @@
+/* eslint no-param-reassign: 0 */
+
 const state = {};
 const state = {};
 const getters = {};
 const getters = {};
 const actions = {};
 const actions = {};

+ 2 - 0
frontend/store/modules/modals.js

@@ -1,3 +1,5 @@
+/* eslint no-param-reassign: 0 */
+
 const state = {
 const state = {
 	modals: {
 	modals: {
 		header: {
 		header: {

+ 2 - 0
frontend/store/modules/station.js

@@ -1,3 +1,5 @@
+/* eslint no-param-reassign: 0 */
+
 const state = {
 const state = {
 	station: {},
 	station: {},
 	editing: {}
 	editing: {}

+ 6 - 2
frontend/store/modules/user.js

@@ -1,3 +1,5 @@
+/* eslint no-param-reassign: 0 */
+
 import auth from "../../api/auth";
 import auth from "../../api/auth";
 import io from "../../io";
 import io from "../../io";
 import validation from "../../validation";
 import validation from "../../validation";
@@ -72,7 +74,8 @@ const modules = {
 								"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."
 						});
 						});
 
 
-					auth.register(user)
+					return auth
+						.register(user)
 						.then(() => {
 						.then(() => {
 							return resolve({
 							return resolve({
 								status: "success",
 								status: "success",
@@ -131,7 +134,8 @@ const modules = {
 											);
 											);
 
 
 											return resolve(res.data);
 											return resolve(res.data);
-										} else return resolve();
+										}
+										return resolve();
 									}
 									}
 								);
 								);
 							});
 							});

+ 1 - 1
frontend/webpack.common.js

@@ -5,7 +5,7 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
 module.exports = {
 module.exports = {
 	entry: "./main.js",
 	entry: "./main.js",
 	output: {
 	output: {
-		path: __dirname + "/dist/build/",
+		path: `${__dirname}/dist/build/`,
 		filename: "[name].[hash].js"
 		filename: "[name].[hash].js"
 	},
 	},
 	plugins: [
 	plugins: [

+ 1 - 1
frontend/webpack.dev.js

@@ -1,4 +1,4 @@
-process.env["NODE_CONFIG_DIR"] = __dirname + "/dist/config/";
+process.env.NODE_CONFIG_DIR = `${__dirname}/dist/config/`;
 const config = require("config");
 const config = require("config");
 
 
 const merge = require("webpack-merge");
 const merge = require("webpack-merge");