diff --git a/src/lib/apis/radarr/radarrApi.ts b/src/lib/apis/radarr/radarrApi.ts index 35b76ad..5a5a586 100644 --- a/src/lib/apis/radarr/radarrApi.ts +++ b/src/lib/apis/radarr/radarrApi.ts @@ -192,3 +192,33 @@ export const getRadarrHealth = async ( }) .then((res) => res.status === 200) .catch(() => false); + +export const getRadarrRootFolders = async ( + baseUrl: string | undefined = undefined, + apiKey: string | undefined = undefined +) => + axios + .get( + (baseUrl || get(settings)?.sonarr.baseUrl) + '/api/v3/rootFolder', + { + headers: { + 'X-Api-Key': apiKey || get(settings)?.sonarr.apiKey + } + } + ) + .then((res) => res.data || []); + +export const getRadarrQualityProfiles = async ( + baseUrl: string | undefined = undefined, + apiKey: string | undefined = undefined +) => + axios + .get( + (baseUrl || get(settings)?.sonarr.baseUrl) + '/api/v3/qualityprofile', + { + headers: { + 'X-Api-Key': apiKey || get(settings)?.sonarr.apiKey + } + } + ) + .then((res) => res.data || []); diff --git a/src/lib/apis/sonarr/sonarrApi.ts b/src/lib/apis/sonarr/sonarrApi.ts index adad45e..d9f763c 100644 --- a/src/lib/apis/sonarr/sonarrApi.ts +++ b/src/lib/apis/sonarr/sonarrApi.ts @@ -257,3 +257,48 @@ export const getSonarrHealth = async ( }) .then((res) => res.status === 200) .catch(() => false); + +export const getSonarrRootFolders = async ( + baseUrl: string | undefined = undefined, + apiKey: string | undefined = undefined +) => + axios + .get( + (baseUrl || get(settings)?.sonarr.baseUrl) + '/api/v3/rootFolder', + { + headers: { + 'X-Api-Key': apiKey || get(settings)?.sonarr.apiKey + } + } + ) + .then((res) => res.data || []); + +export const getSonarrQualityProfiles = async ( + baseUrl: string | undefined = undefined, + apiKey: string | undefined = undefined +) => + axios + .get( + (baseUrl || get(settings)?.sonarr.baseUrl) + '/api/v3/qualityprofile', + { + headers: { + 'X-Api-Key': apiKey || get(settings)?.sonarr.apiKey + } + } + ) + .then((res) => res.data || []); + +export const getSonarrLanguageProfiles = async ( + baseUrl: string | undefined = undefined, + apiKey: string | undefined = undefined +) => + axios + .get( + (baseUrl || get(settings)?.sonarr.baseUrl) + '/api/v3/languageprofile', + { + headers: { + 'X-Api-Key': apiKey || get(settings)?.sonarr.apiKey + } + } + ) + .then((res) => res.data || []); diff --git a/src/lib/apis/tmdb/tmdbApi.ts b/src/lib/apis/tmdb/tmdbApi.ts index 28529b2..b4421df 100644 --- a/src/lib/apis/tmdb/tmdbApi.ts +++ b/src/lib/apis/tmdb/tmdbApi.ts @@ -1,6 +1,6 @@ import { browser } from '$app/environment'; import { TMDB_API_KEY } from '$lib/constants'; -import { getIncludedLanguagesQuery, settings } from '$lib/stores/settings.store'; +import { settings } from '$lib/stores/settings.store'; import { formatDateToYearMonthDay } from '$lib/utils'; import createClient from 'openapi-fetch'; import { get } from 'svelte/store'; @@ -194,7 +194,7 @@ export const getTmdbPopularMovies = () => params: { query: { language: get(settings)?.language, - region: get(settings)?.region + region: get(settings)?.discover.region } } }).then((res) => res.data?.results || []); @@ -208,18 +208,6 @@ export const getTmdbPopularSeries = () => } }).then((res) => res.data?.results || []); -export const getTmdbTrendingAll = () => - TmdbApiOpen.get('/3/trending/all/{time_window}', { - params: { - path: { - time_window: 'day' - }, - query: { - language: get(settings)?.language - } - } - }).then((res) => res.data?.results || []); - export const getTmdbNetworkSeries = (networkId: number) => TmdbApiOpen.get('/3/discover/tv', { params: { @@ -229,44 +217,11 @@ export const getTmdbNetworkSeries = (networkId: number) => } }).then((res) => res.data?.results || []); -export const getTmdbDigitalReleases = () => - TmdbApiOpen.get('/3/discover/movie', { - params: { - query: { - with_release_type: 4, - sort_by: 'popularity.desc', - 'release_date.lte': formatDateToYearMonthDay(new Date()), - ...getIncludedLanguagesQuery() - } - } - }).then((res) => res.data?.results || []); - -export const getTmdbUpcomingMovies = () => - TmdbApiOpen.get('/3/discover/movie', { - params: { - query: { - 'primary_release_date.gte': formatDateToYearMonthDay(new Date()), - sort_by: 'popularity.desc' - // ...getIncludedLanguagesQuery() - } - } - }).then((res) => res.data?.results || []); - -export const getTrendingActors = () => - TmdbApiOpen.get('/3/trending/person/{time_window}', { - params: { - path: { - time_window: 'week' - } - } - }).then((res) => res.data?.results || []); - export const getTmdbGenreMovies = (genreId: number) => TmdbApiOpen.get('/3/discover/movie', { params: { query: { - with_genres: String(genreId), - ...getIncludedLanguagesQuery() + with_genres: String(genreId) } } }).then((res) => res.data?.results || []); diff --git a/src/lib/components/TitleShowcase/TitleShowcase.svelte b/src/lib/components/TitleShowcase/TitleShowcase.svelte index 6a6476d..14a5aed 100644 --- a/src/lib/components/TitleShowcase/TitleShowcase.svelte +++ b/src/lib/components/TitleShowcase/TitleShowcase.svelte @@ -14,7 +14,7 @@ const TRAILER_TIMEOUT = 3000; const TRAILER_LOAD_TIME = 1000; - const ANIMATION_DURATION = 150; + const ANIMATION_DURATION = $settings.animationDuration; export let tmdbId: number; export let type: TitleType; diff --git a/src/lib/components/forms/FormButton.svelte b/src/lib/components/forms/FormButton.svelte index 6ad81c7..a92a562 100644 --- a/src/lib/components/forms/FormButton.svelte +++ b/src/lib/components/forms/FormButton.svelte @@ -9,13 +9,13 @@