From 85a017cf1a04e034f81d66b183074c8144dcf636 Mon Sep 17 00:00:00 2001 From: Mateus Souza Date: Sat, 10 Feb 2024 12:56:39 -0300 Subject: [PATCH] Style: whitespace cleaning --- src/scripts/api.ts | 6 +++--- src/scripts/app.ts | 10 +++++----- src/scripts/explore.ts | 6 +++--- src/scripts/history.ts | 2 +- src/scripts/login.ts | 4 ++-- src/scripts/search.ts | 8 ++++---- src/scripts/serie.ts | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/scripts/api.ts b/src/scripts/api.ts index 866c011..23462ed 100644 --- a/src/scripts/api.ts +++ b/src/scripts/api.ts @@ -61,7 +61,7 @@ const request = async (method: string, endpoint: string, body: any, headers: Hea } const result = await fetch(url, requestOptions) - + if( result.status === 204 ){ return {} as Result } @@ -85,7 +85,7 @@ const makeLogin = async (username: string, password: string) => { scope: 'offline_access', }) - + const headers = new Headers() headers.append('Content-Type', 'application/x-www-form-urlencoded') headers.append('Authorization', 'Basic ' + authToken); @@ -314,7 +314,7 @@ const watchlist = async (accessToken: string, accountId: string, filters: Data) * @returns */ const inWatchlist = async (accessToken: string, accountId: string, filters: Data) => { - + var headers = new Headers() headers.append('Authorization', 'Bearer ' + accessToken) headers.append('Content-Type', 'application/x-www-form-urlencoded') diff --git a/src/scripts/app.ts b/src/scripts/app.ts index b6a1733..8016a5a 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -16,8 +16,8 @@ const getTemplate = async (name: string, data: any) => { /** * Retrieve image information - * @param images - * @returns + * @param images + * @returns */ const getImage = (images: any[]) => { @@ -25,7 +25,7 @@ const getImage = (images: any[]) => { if( images && images.length ){ image.source = images[0][0].source } - + return image } @@ -589,7 +589,7 @@ const setProgress = async (filters: Data, data: Data) => { * @returns */ const serie = async (serieId: string, filters: Data) => { - + await refreshSession() const accessToken = localStorage.getItem('accessToken') @@ -686,7 +686,7 @@ const episode = async (episodeId: string, filters: Data) => { const accessToken = localStorage.getItem('accessToken') const preferredContentAudioLanguage = localStorage.getItem('preferredContentAudioLanguage') const preferredCommunicationLanguage = localStorage.getItem('preferredCommunicationLanguage') - + filters['preferred_audio_language'] = preferredContentAudioLanguage filters['locale'] = preferredCommunicationLanguage diff --git a/src/scripts/explore.ts b/src/scripts/explore.ts index 23be7f1..099832d 100644 --- a/src/scripts/explore.ts +++ b/src/scripts/explore.ts @@ -92,13 +92,13 @@ const listResults: Callback = async ({ state, render }) => { let total = 0 let items = [] - + // Special listings if ( category && special ){ const response = await App.browser({ 'type': 'series', 'sort_by': sort, - 'start': offset.toString(), + 'start': offset.toString(), 'n': limit.toString() }) @@ -118,7 +118,7 @@ const listResults: Callback = async ({ state, render }) => { 'type': 'series', 'categories': category, 'sort_by': sort, - 'start': offset.toString(), + 'start': offset.toString(), 'n': limit.toString() }) diff --git a/src/scripts/history.ts b/src/scripts/history.ts index 6a84fa4..2ceca3a 100644 --- a/src/scripts/history.ts +++ b/src/scripts/history.ts @@ -72,7 +72,7 @@ const listHistory: Callback = async ({ state, render }) => { }) } catch (error) { - + await render({ loaded: true, error: true, diff --git a/src/scripts/login.ts b/src/scripts/login.ts index 1239484..ef27e09 100644 --- a/src/scripts/login.ts +++ b/src/scripts/login.ts @@ -26,8 +26,8 @@ const makeLogin: Callback = async ({ element, render }) => { await App.login(username.value, password.value) Route.redirect('/home') } catch (error) { - await render({ - message: error.message + await render({ + message: error.message }) } diff --git a/src/scripts/search.ts b/src/scripts/search.ts index e9f993f..135c87e 100644 --- a/src/scripts/search.ts +++ b/src/scripts/search.ts @@ -66,13 +66,13 @@ const listResults: Callback = async ({ state, render }) => { const response = await App.search({ 'type': 'series', 'q': query, - 'start': offset.toString(), + 'start': offset.toString(), 'n': limit.toString() }) - const data = { - count: 0, - items: [] + const data = { + count: 0, + items: [] } if( response.data && response.data.length ){ diff --git a/src/scripts/serie.ts b/src/scripts/serie.ts index 3a08cf8..8bbaf05 100644 --- a/src/scripts/serie.ts +++ b/src/scripts/serie.ts @@ -206,7 +206,7 @@ const listEpisodes: Callback = async ({ state, render }) => { }) } catch (error) { - + await render({ loaded: true, error: true, @@ -232,7 +232,7 @@ const onMount: Callback = async (component) => { const serieId = component.state.serieId Route.redirect('/serie/' + serieId + '/season/' + target.value) }) - + on(element, 'change', 'input#sort', (_event, target: HTMLInputElement) => { const serieId = component.state.serieId const seasonId = component.state.seasonId