mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-23 17:28:42 +02:00
format files
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import { base } from '$app/paths';
|
||||
import { onMount } from 'svelte';
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { MetaDataProviderSearchResult } from '$lib/types';
|
||||
import type { MetaDataProviderSearchResult } from '$lib/types';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { Skeleton } from '$lib/components/ui/skeleton';
|
||||
import type { PublicMovie } from '$lib/types';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
let movies;
|
||||
let movies: PublicMovie[] = [];
|
||||
let loading = false;
|
||||
onMount(async () => {
|
||||
loading = true;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { LayoutLoad } from './$types';
|
||||
import type { PageLoad } from './$types';
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, fetch }) => {
|
||||
export const load: PageLoad = async ({ params, fetch }) => {
|
||||
const res = await fetch(`${env.PUBLIC_API_URL}/movies/${params.movieId}`, {
|
||||
credentials: 'include'
|
||||
});
|
||||
|
||||
@@ -43,5 +43,5 @@
|
||||
<h1 class="scroll-m-20 text-center text-4xl font-extrabold tracking-tight lg:text-5xl">
|
||||
Movie Requests
|
||||
</h1>
|
||||
<RequestsTable bind:requests isShow={false} />
|
||||
<RequestsTable {requests} isShow={false} />
|
||||
</div>
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
|
||||
import * as Breadcrumb from '$lib/components/ui/breadcrumb/index.js';
|
||||
import { base } from '$app/paths';
|
||||
import type { User } from '$lib/types';
|
||||
|
||||
let currentUser = getContext('user');
|
||||
let users = page.data.users;
|
||||
let currentUser: () => User = getContext('user');
|
||||
let users = $state(page.data.users);
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -56,7 +57,7 @@
|
||||
<Card.Description>Edit or delete users</Card.Description>
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
<UserTable bind:users />
|
||||
<UserTable {users} />
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
{/if}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
const showData = $derived(data.showData);
|
||||
setContext('show', () => showData);
|
||||
const fetchError = $derived(data.error);
|
||||
const fetchError = $derived((data as { error?: string }).error || null);
|
||||
</script>
|
||||
|
||||
{#if fetchError}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { ImageOff } from 'lucide-svelte';
|
||||
import * as Table from '$lib/components/ui/table/index.js';
|
||||
import { getContext } from 'svelte';
|
||||
import type { RichShowTorrent, Show, User } from '$lib/types.js';
|
||||
import type { PublicShow, RichShowTorrent, Show, User } from '$lib/types.js';
|
||||
import { getFullyQualifiedMediaName } from '$lib/utils';
|
||||
import DownloadSeasonDialog from '$lib/components/download-season-dialog.svelte';
|
||||
import CheckmarkX from '$lib/components/checkmark-x.svelte';
|
||||
@@ -48,10 +48,10 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{getFullyQualifiedMediaName(show)} - MediaManager</title>
|
||||
<title>{getFullyQualifiedMediaName(show())} - MediaManager</title>
|
||||
<meta
|
||||
content="View details and manage downloads for {getFullyQualifiedMediaName(
|
||||
show
|
||||
show()
|
||||
)} in MediaManager"
|
||||
name="description"
|
||||
/>
|
||||
@@ -122,7 +122,7 @@
|
||||
{/if}
|
||||
<DownloadSeasonDialog show={show()} />
|
||||
{/if}
|
||||
<RequestSeasonDialog show={show()} />
|
||||
<RequestSeasonDialog show={show() as PublicShow} />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
@@ -146,7 +146,7 @@
|
||||
>
|
||||
<Table.Cell class="min-w-[10px] font-medium">{season.number}</Table.Cell>
|
||||
<Table.Cell class="min-w-[10px] font-medium">
|
||||
<CheckmarkX state={season.downloaded} />
|
||||
<CheckmarkX state={false} />
|
||||
</Table.Cell>
|
||||
<Table.Cell class="min-w-[50px]">{season.name}</Table.Cell>
|
||||
<Table.Cell class="max-w-[300px] truncate">{season.overview}</Table.Cell>
|
||||
@@ -154,7 +154,7 @@
|
||||
{/each}
|
||||
{:else}
|
||||
<Table.Row>
|
||||
<Table.Cell colspan="3" class="text-center">No season data available.</Table.Cell>
|
||||
<Table.Cell colspan={3} class="text-center">No season data available.</Table.Cell>
|
||||
</Table.Row>
|
||||
{/if}
|
||||
</Table.Body>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
let seasonFiles: PublicSeasonFile[] = $state(page.data.files);
|
||||
let season: Season = $state(page.data.season);
|
||||
let show: ()=> Show = getContext('show');
|
||||
let show: () => Show = getContext('show');
|
||||
|
||||
console.log('loaded files', seasonFiles);
|
||||
</script>
|
||||
|
||||
@@ -39,7 +39,7 @@ export const load: PageLoad = async ({ fetch, params }) => {
|
||||
} catch (error) {
|
||||
console.error('An error occurred while fetching TV show files:', error);
|
||||
return {
|
||||
error: `An unexpected error occurred: ${error.message || 'Unknown error'}`,
|
||||
error: `An unexpected error occurred: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
||||
files: [],
|
||||
season: null
|
||||
};
|
||||
|
||||
@@ -44,5 +44,5 @@
|
||||
<h1 class="scroll-m-20 text-center text-4xl font-extrabold tracking-tight lg:text-5xl">
|
||||
Season Requests
|
||||
</h1>
|
||||
<RequestsTable bind:requests isShow={true} />
|
||||
<RequestsTable {requests} isShow={true} />
|
||||
</div>
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
bind:value={newPassword}
|
||||
disabled={isLoading}
|
||||
required
|
||||
minlength="1"
|
||||
minlength={1}
|
||||
/>
|
||||
</div>
|
||||
<div class="grid gap-2">
|
||||
@@ -120,7 +120,7 @@
|
||||
bind:value={confirmPassword}
|
||||
disabled={isLoading}
|
||||
required
|
||||
minlength="1"
|
||||
minlength={1}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user