From 06b77d686cba6ab6476f98bb70bf5a740648fc95 Mon Sep 17 00:00:00 2001 From: dragongoose Date: Fri, 18 Aug 2023 13:39:26 -0400 Subject: [PATCH] Lint/prettify --- src/assets/messageParser.ts | 6 +- src/assets/qualitySelector.ts | 10 +--- src/components/LanguageSwitcher.vue | 11 +++- src/components/NavbarView.vue | 72 ++++++++++++---------- src/components/user/VideoTab.vue | 4 +- src/mixins.ts | 30 +++++----- src/types/Chat.ts | 12 ++-- src/types/VOD.ts | 2 +- src/views/CategoryView.vue | 46 +++++++------- src/views/HomepageView.vue | 26 ++++---- src/views/SettingsView.vue | 93 +++++++++++++++-------------- src/views/UserView.vue | 7 ++- src/views/VodView.vue | 7 ++- 13 files changed, 177 insertions(+), 149 deletions(-) diff --git a/src/assets/messageParser.ts b/src/assets/messageParser.ts index e2f7bba..77a0de0 100644 --- a/src/assets/messageParser.ts +++ b/src/assets/messageParser.ts @@ -60,7 +60,7 @@ export function parseMessage(messageData: any, allBadges: Badge[]): ParsedMessag return { type: 'CLEARCHAT', data: { - username: message.message.replace(/(\r\n|\n|\r)/gm, ""), + username: message.message.replace(/(\r\n|\n|\r)/gm, ''), duration } } @@ -76,11 +76,11 @@ export function parseMessage(messageData: any, allBadges: Badge[]): ParsedMessag } export function parseChatHistory(messages: StreamMessage[], badges: Badge[]) { - let parsedMessages = [] + const parsedMessages = [] for (let i = 0; i < messages.length; i++) { const message = messages[i] - + const data: ParsedMessage = { type: 'PRIVMSG', data: { diff --git a/src/assets/qualitySelector.ts b/src/assets/qualitySelector.ts index e35e871..3cf4eb7 100644 --- a/src/assets/qualitySelector.ts +++ b/src/assets/qualitySelector.ts @@ -6,12 +6,6 @@ import type { QualityLevelList, QualityLevel } from 'videojs-contrib-quality-lev import i18n from '@/i18n' import { getSetting } from '@/mixins' -const getQualityFromSettings = (qualityLevels) => { - const settings = localStorage.getItem("settings") - const parsed = JSON.parse(settings) - return parsed.defaultQuality.selected -} - export const createQualitySelector = (player: any) => { const qualityLevels: QualityLevelList = player.qualityLevels() const MenuButton = videojs.getComponent('MenuButton') @@ -53,7 +47,7 @@ export const createQualitySelector = (player: any) => { } // set quality on startup - const startingQuality = getSetting("defaultQuality") + const startingQuality = getSetting('defaultQuality') const id = formatedQualities.find((i) => i.name === startingQuality)?.id setQuality(id) @@ -88,4 +82,4 @@ export const createQualitySelector = (player: any) => { formattedLevels.push(formatedQualities) updateLevels() }) -} \ No newline at end of file +} diff --git a/src/components/LanguageSwitcher.vue b/src/components/LanguageSwitcher.vue index 7d49b8e..97c4216 100644 --- a/src/components/LanguageSwitcher.vue +++ b/src/components/LanguageSwitcher.vue @@ -18,7 +18,16 @@ export default { setup() { return { langs: ['en-US', 'es-ES', 'nl-NL', 'pt-PT', 'fa-IR', 'he-IL', 'ru-RU', 'ko-KR'], - names: ['English', 'Español', 'Nederlands', 'Português', 'فارسی', 'עִבְרִית', 'Русский', '한국어'] + names: [ + 'English', + 'Español', + 'Nederlands', + 'Português', + 'فارسی', + 'עִבְרִית', + 'Русский', + '한국어' + ] } }, mounted() { diff --git a/src/components/NavbarView.vue b/src/components/NavbarView.vue index 4adee4d..5e1d821 100644 --- a/src/components/NavbarView.vue +++ b/src/components/NavbarView.vue @@ -14,44 +14,52 @@ export default { }, methods: { toggle() { - this.open = !this.open + this.open = !this.open } } } diff --git a/src/components/user/VideoTab.vue b/src/components/user/VideoTab.vue index 0130010..87cb5f9 100644 --- a/src/components/user/VideoTab.vue +++ b/src/components/user/VideoTab.vue @@ -5,10 +5,10 @@ diff --git a/src/views/SettingsView.vue b/src/views/SettingsView.vue index 64d6eb2..8639f79 100644 --- a/src/views/SettingsView.vue +++ b/src/views/SettingsView.vue @@ -2,25 +2,25 @@ import { getDefaultSettings } from '@/mixins' export default { - setup() { - let settings + setup() { + let settings - let storedSettings = localStorage.getItem("settings") - if (storedSettings === null) { - settings = getDefaultSettings() - } else { - settings = JSON.parse(storedSettings) - } + let storedSettings = localStorage.getItem('settings') + if (storedSettings === null) { + settings = getDefaultSettings() + } else { + settings = JSON.parse(storedSettings) + } - return { - settings - } - }, - methods: { - save() { - const settings = JSON.stringify(this.settings) - localStorage.setItem('settings', settings) - }, + return { + settings + } + }, + methods: { + save() { + const settings = JSON.stringify(this.settings) + localStorage.setItem('settings', settings) + } // download() { // var hiddenElement = document.createElement('a'); @@ -40,37 +40,42 @@ export default { // this.settings = file // this.save() // }, - } - } + } +} \ No newline at end of file + + + diff --git a/src/views/UserView.vue b/src/views/UserView.vue index d00e645..3725e25 100644 --- a/src/views/UserView.vue +++ b/src/views/UserView.vue @@ -168,6 +168,11 @@ export default { - + diff --git a/src/views/VodView.vue b/src/views/VodView.vue index e811666..4f09264 100644 --- a/src/views/VodView.vue +++ b/src/views/VodView.vue @@ -137,6 +137,11 @@ export default { - +