mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-24 09:45:43 +02:00
fix linting errors
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import type { MetaDataProviderSearchResult } from '$lib/types.js';
|
||||
import { SvelteURLSearchParams } from 'svelte/reactivity';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
let loading = $state(false);
|
||||
@@ -17,7 +18,7 @@
|
||||
async function addMedia() {
|
||||
loading = true;
|
||||
const endpoint = isShow ? '/tv/shows' : '/movies';
|
||||
const urlParams = new URLSearchParams();
|
||||
const urlParams = new SvelteURLSearchParams();
|
||||
urlParams.append(isShow ? 'show_id' : 'movie_id', String(result.external_id));
|
||||
urlParams.append('metadata_provider', result.metadata_provider);
|
||||
const urlString = `${apiUrl}${endpoint}?${urlParams.toString()}`;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { Label } from '$lib/components/ui/label';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { Badge } from '$lib/components/ui/badge/index.js';
|
||||
import { SvelteURLSearchParams } from 'svelte/reactivity';
|
||||
|
||||
import type { PublicIndexerQueryResult } from '$lib/types.js';
|
||||
import { getFullyQualifiedMediaName } from '$lib/utils';
|
||||
@@ -24,7 +25,7 @@
|
||||
let filePathSuffix: string = $state('');
|
||||
|
||||
async function downloadTorrent(result_id: string) {
|
||||
const urlParams = new URLSearchParams();
|
||||
const urlParams = new SvelteURLSearchParams();
|
||||
urlParams.append('public_indexer_result_id', result_id);
|
||||
if (filePathSuffix !== '') {
|
||||
urlParams.append('override_file_path_suffix', filePathSuffix);
|
||||
@@ -72,7 +73,7 @@
|
||||
torrentsError = null;
|
||||
torrents = [];
|
||||
|
||||
const urlParams = new URLSearchParams();
|
||||
const urlParams = new SvelteURLSearchParams();
|
||||
if (override) {
|
||||
urlParams.append('search_query_override', queryOverride);
|
||||
}
|
||||
@@ -256,7 +257,7 @@
|
||||
<Table.Cell>{torrent.seeders}</Table.Cell>
|
||||
<Table.Cell>{torrent.score}</Table.Cell>
|
||||
<Table.Cell>
|
||||
{#each torrent.flags as flag}
|
||||
{#each torrent.flags as flag (flag)}
|
||||
<Badge variant="outline">{flag}</Badge>
|
||||
{/each}
|
||||
</Table.Cell>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { Input } from '$lib/components/ui/input';
|
||||
import { Label } from '$lib/components/ui/label';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { SvelteURLSearchParams } from 'svelte/reactivity';
|
||||
|
||||
import type { PublicIndexerQueryResult } from '$lib/types.js';
|
||||
import {
|
||||
@@ -29,7 +30,7 @@
|
||||
let filePathSuffix: string = $state('');
|
||||
|
||||
async function downloadTorrent(result_id: string) {
|
||||
const urlParams = new URLSearchParams();
|
||||
const urlParams = new SvelteURLSearchParams();
|
||||
urlParams.append('public_indexer_result_id', result_id);
|
||||
urlParams.append('show_id', show.id);
|
||||
if (filePathSuffix !== '') {
|
||||
@@ -82,7 +83,7 @@
|
||||
torrentsError = null;
|
||||
torrents = [];
|
||||
|
||||
const urlParams = new URLSearchParams();
|
||||
const urlParams = new SvelteURLSearchParams();
|
||||
urlParams.append('show_id', show.id);
|
||||
if (override) {
|
||||
urlParams.append('search_query_override', queryOverride);
|
||||
@@ -308,7 +309,7 @@
|
||||
>
|
||||
<Table.Cell>{torrent.score}</Table.Cell>
|
||||
<Table.Cell>
|
||||
{#each torrent.flags as flag}
|
||||
{#each torrent.flags as flag (flag)}
|
||||
<Badge variant="outline">{flag}</Badge>
|
||||
{/each}
|
||||
</Table.Cell>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { SvelteURLSearchParams } from 'svelte/reactivity';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
|
||||
@@ -58,7 +59,7 @@
|
||||
|
||||
const endpoint =
|
||||
mediaType === 'tv' ? `/tv/shows/${media.id}/library` : `/movies/${media.id}/library`;
|
||||
const urlParams = new URLSearchParams();
|
||||
const urlParams = new SvelteURLSearchParams();
|
||||
urlParams.append('library', selectedLabel);
|
||||
const urlString = `${apiUrl}${endpoint}?${urlParams.toString()}`;
|
||||
try {
|
||||
@@ -97,7 +98,7 @@
|
||||
role="combobox"
|
||||
aria-expanded={open}
|
||||
>
|
||||
{'Select Library'}
|
||||
Select Library
|
||||
<ChevronsUpDownIcon class="opacity-50" />
|
||||
</Button>
|
||||
{/snippet}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
import * as Alert from '$lib/components/ui/alert/index.js';
|
||||
import AlertCircleIcon from '@lucide/svelte/icons/alert-circle';
|
||||
import LoadingBar from '$lib/components/loading-bar.svelte';
|
||||
import { SvelteURLSearchParams } from 'svelte/reactivity';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
|
||||
@@ -20,7 +21,6 @@
|
||||
oauth_name: string;
|
||||
};
|
||||
} = $props();
|
||||
let oauthProviderName = $derived(oauthProvider.oauth_name);
|
||||
|
||||
let email = $state('');
|
||||
let password = $state('');
|
||||
@@ -33,7 +33,7 @@
|
||||
isLoading = true;
|
||||
errorMessage = '';
|
||||
|
||||
const formData = new URLSearchParams();
|
||||
const formData = new SvelteURLSearchParams();
|
||||
formData.append('username', email);
|
||||
formData.append('password', password);
|
||||
try {
|
||||
@@ -75,7 +75,7 @@
|
||||
async function handleOauth() {
|
||||
try {
|
||||
const response = await fetch(
|
||||
apiUrl + '/auth/cookie/' + oauthProviderName + '/authorize?scopes=email',
|
||||
apiUrl + '/auth/cookie/' + oauthProvider.oauth_name + '/authorize?scopes=email',
|
||||
{
|
||||
method: 'GET',
|
||||
headers: {
|
||||
@@ -87,11 +87,11 @@
|
||||
let result = await response.json();
|
||||
console.log(
|
||||
'Redirecting to OAuth provider:',
|
||||
oauthProviderName,
|
||||
oauthProvider.oauth_name,
|
||||
'url: ',
|
||||
result.authorization_url
|
||||
);
|
||||
toast.success('Redirecting to ' + oauthProviderName + ' for authentication...');
|
||||
toast.success('Redirecting to ' + oauthProvider.oauth_name + ' for authentication...');
|
||||
window.location = result.authorization_url;
|
||||
} else {
|
||||
let errorText = await response.text();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<Skeleton class="h-[70vh] w-full" />
|
||||
<Skeleton class="h-[70vh] w-full" />
|
||||
{:else}
|
||||
{#each media.slice(0, 3) as mediaItem}
|
||||
{#each media.slice(0, 3) as mediaItem (mediaItem.external_id)}
|
||||
<AddMediaCard {isShow} result={mediaItem} />
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
oauth_name: string;
|
||||
};
|
||||
} = $props();
|
||||
let oauthProviderName = $derived(oauthProvider.oauth_name);
|
||||
|
||||
async function handleSignup(event: Event) {
|
||||
event.preventDefault();
|
||||
@@ -72,6 +71,10 @@
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
function handleOauth() {
|
||||
// Implement OAuth logic or leave as stub if not needed
|
||||
}
|
||||
</script>
|
||||
|
||||
<Card.Root class="mx-auto max-w-sm">
|
||||
@@ -142,4 +145,3 @@
|
||||
</div>
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
{#each torrents as torrent}
|
||||
{#each torrents as torrent (torrent.id)}
|
||||
<Table.Row>
|
||||
<Table.Cell class="font-medium">
|
||||
{torrent.torrent_title}
|
||||
@@ -41,7 +41,7 @@
|
||||
<Table.Cell class="font-medium">
|
||||
{getTorrentQualityString(torrent.quality)}
|
||||
</Table.Cell>
|
||||
<Table.Cell class="font-medium">
|
||||
<Table.Cell>
|
||||
{torrent.file_path_suffix}
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
{#each sortedUsers as user}
|
||||
{#each sortedUsers as user (user.id)}
|
||||
<Table.Row>
|
||||
<Table.Cell class="font-medium">
|
||||
{user.email}
|
||||
|
||||
Reference in New Issue
Block a user