mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-21 05:15:13 +02:00
format frontend code
This commit is contained in:
@@ -1 +1 @@
|
||||
export const ssr = false;
|
||||
export const ssr = false;
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
<script lang="ts">
|
||||
import {goto} from '$app/navigation';
|
||||
import {base} from '$app/paths';
|
||||
import {onMount} from 'svelte';
|
||||
import {browser} from "$app/environment";
|
||||
import {redirect} from "@sveltejs/kit";
|
||||
|
||||
if (browser)
|
||||
goto(base + '/dashboard');
|
||||
else
|
||||
throw redirect(307, '/login');
|
||||
import {goto} from '$app/navigation';
|
||||
import {base} from '$app/paths';
|
||||
import {browser} from '$app/environment';
|
||||
import {redirect} from '@sveltejs/kit';
|
||||
|
||||
if (browser) goto(base + '/dashboard');
|
||||
else throw redirect(307, '/login');
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Home</title>
|
||||
<meta content="Svelte demo app" name="description"/>
|
||||
<meta content="Svelte demo app" name="description"/>
|
||||
</svelte:head>
|
||||
<h1>Servas</h1>
|
||||
|
||||
@@ -2,7 +2,7 @@ import {env} from '$env/dynamic/public';
|
||||
import type {LayoutLoad} from './$types';
|
||||
import {redirect} from '@sveltejs/kit';
|
||||
import {base} from '$app/paths';
|
||||
import {browser} from "$app/environment";
|
||||
import {browser} from '$app/environment';
|
||||
import {goto} from '$app/navigation';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
@@ -23,5 +23,5 @@ export const load: LayoutLoad = async ({fetch}) => {
|
||||
throw redirect(303, base + '/login');
|
||||
}
|
||||
}
|
||||
return {user: await response.json()};
|
||||
return {user: await response.json()};
|
||||
};
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<script lang="ts">
|
||||
import {Separator} from '$lib/components/ui/separator/index.js';
|
||||
import {Separator} from '$lib/components/ui/separator/index.js';
|
||||
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
|
||||
import * as Breadcrumb from '$lib/components/ui/breadcrumb/index.js';
|
||||
import RecommendedShowsCarousel from '$lib/components/recommended-shows-carousel.svelte';
|
||||
import LoadingBar from '$lib/components/loading-bar.svelte';
|
||||
import {base} from '$app/paths';
|
||||
import {page} from '$app/state';
|
||||
import type {MetaDataProviderShowSearchResult} from '$lib/types';
|
||||
import {base} from '$app/paths';
|
||||
import {page} from '$app/state';
|
||||
import type {MetaDataProviderShowSearchResult} from '$lib/types';
|
||||
|
||||
let recommendedShows: Promise<MetaDataProviderShowSearchResult[]> = page.data.tvRecommendations;
|
||||
</script>
|
||||
|
||||
<header class="flex h-16 shrink-0 items-center gap-2">
|
||||
<div class="flex items-center gap-2 px-4">
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Breadcrumb.Root>
|
||||
<Breadcrumb.List>
|
||||
<Breadcrumb.Item class="hidden md:block">
|
||||
<Breadcrumb.Link href="{base}/dashboard">MediaManager</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Page>Home</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
@@ -33,14 +33,16 @@
|
||||
Dashboard
|
||||
</h1>
|
||||
<div class="min-h-[100vh] flex-1 items-center justify-center rounded-xl p-4 md:min-h-min">
|
||||
<div class="mx-auto max-w-[80vw] sm:max-w-[200px] md:max-w-[500px] lg:max-w-[750px] xl:max-w-[1200px]">
|
||||
<div
|
||||
class="mx-auto max-w-[80vw] sm:max-w-[200px] md:max-w-[500px] lg:max-w-[750px] xl:max-w-[1200px]"
|
||||
>
|
||||
<h3 class="my-4 scroll-m-20 text-center text-2xl font-semibold tracking-tight">
|
||||
Trending Shows
|
||||
</h3>
|
||||
{#await recommendedShows}
|
||||
<LoadingBar/>
|
||||
<LoadingBar/>
|
||||
{:then recommendations}
|
||||
<RecommendedShowsCarousel shows={recommendations}/>
|
||||
<RecommendedShowsCarousel shows={recommendations}/>
|
||||
{/await}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {env} from '$env/dynamic/public';
|
||||
import type {PageLoad} from './$types';
|
||||
import {browser} from "$app/environment";
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
|
||||
@@ -13,5 +12,5 @@ export const load: PageLoad = async ({fetch}) => {
|
||||
credentials: 'include'
|
||||
});
|
||||
|
||||
return {tvRecommendations: await response.json()};
|
||||
return {tvRecommendations: await response.json()};
|
||||
};
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<script lang="ts">
|
||||
import {Separator} from '$lib/components/ui/separator/index.js';
|
||||
import {Separator} from '$lib/components/ui/separator/index.js';
|
||||
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 {base} from '$app/paths';
|
||||
import logo from '$lib/images/logo.svg';
|
||||
import {PUBLIC_VERSION} from '$env/static/public';
|
||||
import {PUBLIC_VERSION} from '$env/static/public';
|
||||
</script>
|
||||
|
||||
<header class="flex h-16 shrink-0 items-center gap-2">
|
||||
<div class="flex items-center gap-2 px-4">
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Breadcrumb.Root>
|
||||
<Breadcrumb.List>
|
||||
<Breadcrumb.Item class="hidden md:block">
|
||||
<Breadcrumb.Link href="{base}/dashboard">MediaManager</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Page>About</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
@@ -26,7 +26,7 @@
|
||||
</header>
|
||||
|
||||
<div class="flex w-full flex-col items-center justify-center px-4 py-12">
|
||||
<img alt="Media Manager Logo" class="mb-4 h-24 w-24" src={logo}/>
|
||||
<img alt="Media Manager Logo" class="mb-4 h-24 w-24" src={logo}/>
|
||||
<h1 class="mb-2 text-4xl font-bold">About Media Manager</h1>
|
||||
<p class="mb-6 max-w-2xl text-center text-lg">
|
||||
<strong>Media Manager</strong> is an all-in-one solution for organizing and building your media library.
|
||||
@@ -39,24 +39,24 @@
|
||||
<div class="my-6 mb-6 flex items-center gap-2 text-sm text-muted-foreground sm:w-1/2 lg:w-1/3">
|
||||
<a class="flex items-center gap-2" href="https://www.themoviedb.org/" target="_blank">
|
||||
<img
|
||||
alt="TMDB Logo"
|
||||
class="h-auto w-20"
|
||||
src="https://www.themoviedb.org/assets/2/v4/logos/v2/blue_square_2-d537fb228cf3ded904ef09b136fe3fec72548ebc1fea3fbbd1ad9e36364db38b.svg"
|
||||
alt="TMDB Logo"
|
||||
class="h-auto w-20"
|
||||
src="https://www.themoviedb.org/assets/2/v4/logos/v2/blue_square_2-d537fb228cf3ded904ef09b136fe3fec72548ebc1fea3fbbd1ad9e36364db38b.svg"
|
||||
/>
|
||||
<span
|
||||
>Metadata provided by TMDB. Please consider adding missing information or subscribing.</span
|
||||
>Metadata provided by TMDB. Please consider adding missing information or subscribing.</span
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
<div class="my-6 mb-6 flex items-center gap-2 text-sm text-muted-foreground sm:w-1/2 lg:w-1/3">
|
||||
<a class="flex items-center gap-2" href="https://thetvdb.com/subscribe" target="_blank">
|
||||
<img
|
||||
alt="TheTVDB Logo"
|
||||
class="h-auto w-20"
|
||||
src="https://www.thetvdb.com/images/attribution/logo2.png"
|
||||
alt="TheTVDB Logo"
|
||||
class="h-auto w-20"
|
||||
src="https://www.thetvdb.com/images/attribution/logo2.png"
|
||||
/>
|
||||
<span
|
||||
>Metadata provided by TheTVDB. Please consider adding missing information or subscribing.</span
|
||||
>Metadata provided by TheTVDB. Please consider adding missing information or subscribing.</span
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import UserTable from '$lib/components/user-data-table.svelte';
|
||||
import {page} from '$app/state';
|
||||
import {page} from '$app/state';
|
||||
import * as Card from '$lib/components/ui/card/index.js';
|
||||
import {getContext} from 'svelte';
|
||||
import {getContext} from 'svelte';
|
||||
import UserSettings from '$lib/components/user-settings.svelte';
|
||||
import {Separator} from '$lib/components/ui/separator';
|
||||
import {Separator} from '$lib/components/ui/separator';
|
||||
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 {base} from '$app/paths';
|
||||
|
||||
let currentUser = getContext('user');
|
||||
let users = page.data.users;
|
||||
@@ -15,14 +15,14 @@
|
||||
|
||||
<header class="flex h-16 shrink-0 items-center gap-2">
|
||||
<div class="flex items-center gap-2 px-4">
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Breadcrumb.Root>
|
||||
<Breadcrumb.List>
|
||||
<Breadcrumb.Item class="hidden md:block">
|
||||
<Breadcrumb.Link href="{base}/dashboard">MediaManager</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Page>Settings</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
@@ -41,7 +41,7 @@
|
||||
<Card.Description>Change your email or password</Card.Description>
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
<UserSettings/>
|
||||
<UserSettings/>
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
{#if currentUser().is_superuser}
|
||||
@@ -51,7 +51,7 @@
|
||||
<Card.Description>Edit or delete users</Card.Description>
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
<UserTable bind:users/>
|
||||
<UserTable bind:users/>
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
{/if}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {env} from '$env/dynamic/public';
|
||||
import type {PageLoad} from './$types';
|
||||
import {browser} from "$app/environment";
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
export const load: PageLoad = async ({fetch}) => {
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
<script lang="ts">
|
||||
import {page} from '$app/state';
|
||||
import * as Card from '$lib/components/ui/card/index.js';
|
||||
import {env} from '$env/dynamic/public';
|
||||
import {Separator} from '$lib/components/ui/separator/index.js';
|
||||
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
|
||||
import * as Breadcrumb from '$lib/components/ui/breadcrumb/index.js';
|
||||
import {getFullyQualifiedShowName} from '$lib/utils';
|
||||
import logo from '$lib/images/svelte-logo.svg';
|
||||
import LoadingBar from '$lib/components/loading-bar.svelte';
|
||||
import ShowPicture from "$lib/components/show-picture.svelte";
|
||||
import ShowPicture from '$lib/components/show-picture.svelte';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL
|
||||
let tvShowsPromise = page.data.tvShows;
|
||||
</script>
|
||||
|
||||
@@ -63,15 +60,12 @@
|
||||
<Card.Description class="truncate">{show.overview}</Card.Description>
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
<ShowPicture show={show}/>
|
||||
<ShowPicture {show}/>
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
</a>
|
||||
|
||||
{:else}
|
||||
<div class="col-span-full text-center text-muted-foreground">
|
||||
No TV shows added yet.
|
||||
</div>
|
||||
<div class="col-span-full text-center text-muted-foreground">No TV shows added yet.</div>
|
||||
{/each}
|
||||
{/await}
|
||||
{/await}
|
||||
|
||||
@@ -12,5 +12,5 @@ export const load: PageLoad = async ({fetch}) => {
|
||||
credentials: 'include'
|
||||
});
|
||||
|
||||
return {tvShows: response};
|
||||
return {tvShows: response};
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import {setContext} from 'svelte';
|
||||
import type {LayoutProps} from './$types';
|
||||
import {setContext} from 'svelte';
|
||||
import type {LayoutProps} from './$types';
|
||||
|
||||
let {data, children}: LayoutProps = $props();
|
||||
let {data, children}: LayoutProps = $props();
|
||||
|
||||
const showData = $derived(data.showData);
|
||||
setContext('show', () => showData);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {env} from '$env/dynamic/public';
|
||||
import type {LayoutLoad} from './$types';
|
||||
import {browser} from "$app/environment";
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
export const load: LayoutLoad = async ({params, fetch}) => {
|
||||
|
||||
@@ -1,159 +1,159 @@
|
||||
<script lang="ts">
|
||||
import {env} from '$env/dynamic/public';
|
||||
import {Separator} from '$lib/components/ui/separator/index.js';
|
||||
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
|
||||
import * as Breadcrumb from '$lib/components/ui/breadcrumb/index.js';
|
||||
import {goto} from '$app/navigation';
|
||||
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 {getFullyQualifiedShowName} from '$lib/utils';
|
||||
import DownloadSeasonDialog from '$lib/components/download-season-dialog.svelte';
|
||||
import CheckmarkX from '$lib/components/checkmark-x.svelte';
|
||||
import {page} from '$app/state';
|
||||
import TorrentTable from '$lib/components/torrent-table.svelte';
|
||||
import RequestSeasonDialog from '$lib/components/request-season-dialog.svelte';
|
||||
import {browser} from "$app/environment";
|
||||
import ShowPicture from "$lib/components/show-picture.svelte";
|
||||
import {Checkbox} from "$lib/components/ui/checkbox/index.js";
|
||||
import {toast} from 'svelte-sonner';
|
||||
import {Label} from "$lib/components/ui/label";
|
||||
import {env} from '$env/dynamic/public';
|
||||
import {Separator} from '$lib/components/ui/separator/index.js';
|
||||
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
|
||||
import * as Breadcrumb from '$lib/components/ui/breadcrumb/index.js';
|
||||
import {goto} from '$app/navigation';
|
||||
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 {getFullyQualifiedShowName} from '$lib/utils';
|
||||
import DownloadSeasonDialog from '$lib/components/download-season-dialog.svelte';
|
||||
import CheckmarkX from '$lib/components/checkmark-x.svelte';
|
||||
import {page} from '$app/state';
|
||||
import TorrentTable from '$lib/components/torrent-table.svelte';
|
||||
import RequestSeasonDialog from '$lib/components/request-season-dialog.svelte';
|
||||
import ShowPicture from '$lib/components/show-picture.svelte';
|
||||
import {Checkbox} from '$lib/components/ui/checkbox/index.js';
|
||||
import {toast} from 'svelte-sonner';
|
||||
import {Label} from '$lib/components/ui/label';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL
|
||||
let show: () => Show = getContext('show');
|
||||
let user: () => User = getContext('user');
|
||||
let torrents: RichShowTorrent = page.data.torrentsData;
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
let show: () => Show = getContext('show');
|
||||
let user: () => User = getContext('user');
|
||||
let torrents: RichShowTorrent = page.data.torrentsData;
|
||||
|
||||
async function toggle_continuous_download() {
|
||||
let url = new URL(apiUrl + "/tv/shows/" + show().id + "/continuousDownload");
|
||||
url.searchParams.append('continuous_download', !show().continuous_download);
|
||||
console.log("Toggling continuous download for show", show().name, "to", !show().continuous_download);
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
credentials: 'include'
|
||||
});
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
toast.error("Failed to toggle continuous download: " + errorText);
|
||||
} else {
|
||||
show().continuous_download = !show().continuous_download;
|
||||
toast.success("Continuous download toggled successfully.");
|
||||
}
|
||||
}
|
||||
|
||||
async function toggle_continuous_download() {
|
||||
let url = new URL(apiUrl + '/tv/shows/' + show().id + '/continuousDownload');
|
||||
url.searchParams.append('continuous_download', !show().continuous_download);
|
||||
console.log(
|
||||
'Toggling continuous download for show',
|
||||
show().name,
|
||||
'to',
|
||||
!show().continuous_download
|
||||
);
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
credentials: 'include'
|
||||
});
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
toast.error('Failed to toggle continuous download: ' + errorText);
|
||||
} else {
|
||||
show().continuous_download = !show().continuous_download;
|
||||
toast.success('Continuous download toggled successfully.');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<header class="flex h-16 shrink-0 items-center gap-2">
|
||||
<div class="flex items-center gap-2 px-4">
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Breadcrumb.Root>
|
||||
<Breadcrumb.List>
|
||||
<Breadcrumb.Item class="hidden md:block">
|
||||
<Breadcrumb.Link href="/dashboard">MediaManager</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Link href="/dashboard">Home</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Link href="/dashboard/tv">Shows</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Page>{getFullyQualifiedShowName(show())}</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
</Breadcrumb.List>
|
||||
</Breadcrumb.Root>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 px-4">
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Breadcrumb.Root>
|
||||
<Breadcrumb.List>
|
||||
<Breadcrumb.Item class="hidden md:block">
|
||||
<Breadcrumb.Link href="/dashboard">MediaManager</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Link href="/dashboard">Home</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Link href="/dashboard/tv">Shows</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Page>{getFullyQualifiedShowName(show())}</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
</Breadcrumb.List>
|
||||
</Breadcrumb.Root>
|
||||
</div>
|
||||
</header>
|
||||
<h1 class="scroll-m-20 text-center text-4xl font-extrabold tracking-tight lg:text-5xl">
|
||||
{getFullyQualifiedShowName(show())}
|
||||
{getFullyQualifiedShowName(show())}
|
||||
</h1>
|
||||
<div class="flex flex-1 w-full flex-col gap-4 p-4">
|
||||
<div class="flex flex-col md:flex-row md:items-stretch gap-4">
|
||||
<div class="w-full md:w-1/3 md:max-w-sm rounded-xl bg-muted/50 overflow-hidden">
|
||||
{#if show().id}
|
||||
<ShowPicture show={show()}/>
|
||||
{:else}
|
||||
<div
|
||||
class="aspect-9/16 flex h-auto w-full items-center justify-center rounded-lg bg-gray-200 text-gray-500"
|
||||
>
|
||||
<ImageOff size={48}/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="w-full md:w-1/4 flex-auto rounded-xl bg-muted/50 p-4">
|
||||
<p class="leading-7 [&:not(:first-child)]:mt-6">
|
||||
{show().overview}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="w-full md:w-1/3 flex-auto rounded-xl bg-muted/50 p-4"
|
||||
>
|
||||
{#if user().is_superuser}
|
||||
{#if !show().ended}
|
||||
<div class="my-2 mx-1 block">
|
||||
<Checkbox
|
||||
checked={show().continuous_download}
|
||||
onCheckedChange={() => {
|
||||
toggle_continuous_download()
|
||||
}}
|
||||
id="continuous-download-checkbox"
|
||||
|
||||
/>
|
||||
<Label for="continuous-download-checkbox">
|
||||
Enable automatic download of future seasons
|
||||
</Label>
|
||||
<hr>
|
||||
</div>
|
||||
{/if}
|
||||
<DownloadSeasonDialog show={show()}/>
|
||||
{/if}
|
||||
<RequestSeasonDialog show={show()}/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<Table.Root>
|
||||
<Table.Caption>A list of all seasons.</Table.Caption>
|
||||
<Table.Header>
|
||||
<Table.Row>
|
||||
<Table.Head>Number</Table.Head>
|
||||
<Table.Head>Exists on file</Table.Head>
|
||||
<Table.Head>Title</Table.Head>
|
||||
<Table.Head>Overview</Table.Head>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
{#if show().seasons.length > 0}
|
||||
{#each show().seasons as season (season.id)}
|
||||
<Table.Row
|
||||
link={true}
|
||||
onclick={() => goto('/dashboard/tv/' + show().id + '/' + season.id)}
|
||||
>
|
||||
<Table.Cell class="min-w-[10px] font-medium">{season.number}</Table.Cell>
|
||||
<Table.Cell class="min-w-[10px] font-medium">
|
||||
<CheckmarkX state={season.downloaded}/>
|
||||
</Table.Cell>
|
||||
<Table.Cell class="min-w-[50px]">{season.name}</Table.Cell>
|
||||
<Table.Cell class="max-w-[300px] truncate">{season.overview}</Table.Cell>
|
||||
</Table.Row>
|
||||
{/each}
|
||||
{:else}
|
||||
<Table.Row>
|
||||
<Table.Cell colspan="3" class="text-center">No season data available.</Table.Cell>
|
||||
</Table.Row>
|
||||
{/if}
|
||||
</Table.Body>
|
||||
</Table.Root>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<TorrentTable torrents={torrents.torrents}/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex w-full flex-1 flex-col gap-4 p-4">
|
||||
<div class="flex flex-col gap-4 md:flex-row md:items-stretch">
|
||||
<div class="w-full overflow-hidden rounded-xl bg-muted/50 md:w-1/3 md:max-w-sm">
|
||||
{#if show().id}
|
||||
<ShowPicture show={show()}/>
|
||||
{:else}
|
||||
<div
|
||||
class="aspect-9/16 flex h-auto w-full items-center justify-center rounded-lg bg-gray-200 text-gray-500"
|
||||
>
|
||||
<ImageOff size={48}/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="w-full flex-auto rounded-xl bg-muted/50 p-4 md:w-1/4">
|
||||
<p class="leading-7 [&:not(:first-child)]:mt-6">
|
||||
{show().overview}
|
||||
</p>
|
||||
</div>
|
||||
<div class="w-full flex-auto rounded-xl bg-muted/50 p-4 md:w-1/3">
|
||||
{#if user().is_superuser}
|
||||
{#if !show().ended}
|
||||
<div class="mx-1 my-2 block">
|
||||
<Checkbox
|
||||
checked={show().continuous_download}
|
||||
onCheckedChange={() => {
|
||||
toggle_continuous_download();
|
||||
}}
|
||||
id="continuous-download-checkbox"
|
||||
/>
|
||||
<Label for="continuous-download-checkbox">
|
||||
Enable automatic download of future seasons
|
||||
</Label>
|
||||
<hr/>
|
||||
</div>
|
||||
{/if}
|
||||
<DownloadSeasonDialog show={show()}/>
|
||||
{/if}
|
||||
<RequestSeasonDialog show={show()}/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<Table.Root>
|
||||
<Table.Caption>A list of all seasons.</Table.Caption>
|
||||
<Table.Header>
|
||||
<Table.Row>
|
||||
<Table.Head>Number</Table.Head>
|
||||
<Table.Head>Exists on file</Table.Head>
|
||||
<Table.Head>Title</Table.Head>
|
||||
<Table.Head>Overview</Table.Head>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
{#if show().seasons.length > 0}
|
||||
{#each show().seasons as season (season.id)}
|
||||
<Table.Row
|
||||
link={true}
|
||||
onclick={() => goto('/dashboard/tv/' + show().id + '/' + season.id)}
|
||||
>
|
||||
<Table.Cell class="min-w-[10px] font-medium">{season.number}</Table.Cell>
|
||||
<Table.Cell class="min-w-[10px] font-medium">
|
||||
<CheckmarkX state={season.downloaded}/>
|
||||
</Table.Cell>
|
||||
<Table.Cell class="min-w-[50px]">{season.name}</Table.Cell>
|
||||
<Table.Cell class="max-w-[300px] truncate">{season.overview}</Table.Cell>
|
||||
</Table.Row>
|
||||
{/each}
|
||||
{:else}
|
||||
<Table.Row>
|
||||
<Table.Cell colspan="3" class="text-center">No season data available.</Table.Cell>
|
||||
</Table.Row>
|
||||
{/if}
|
||||
</Table.Body>
|
||||
</Table.Root>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<TorrentTable torrents={torrents.torrents}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
import type {PublicSeasonFile, Season, Show} from '$lib/types';
|
||||
import CheckmarkX from '$lib/components/checkmark-x.svelte';
|
||||
import {getFullyQualifiedShowName, getTorrentQualityString} from '$lib/utils';
|
||||
import {env} from "$env/dynamic/public";
|
||||
import ShowPicture from "$lib/components/show-picture.svelte";
|
||||
import ShowPicture from '$lib/components/show-picture.svelte';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL
|
||||
let seasonFiles: PublicSeasonFile[] = $state(page.data.files);
|
||||
let season: Season = $state(page.data.season);
|
||||
let show: Show = getContext('show');
|
||||
@@ -55,16 +53,16 @@
|
||||
{getFullyQualifiedShowName(show())} Season {season.number}
|
||||
</h1>
|
||||
<div class="flex flex-1 flex-col gap-4 p-4">
|
||||
<div class="flex flex-col md:flex-row md:items-stretch gap-4">
|
||||
<div class="w-full md:w-1/3 md:max-w-sm rounded-xl bg-muted/50 overflow-hidden">
|
||||
<div class="flex flex-col gap-4 md:flex-row md:items-stretch">
|
||||
<div class="w-full overflow-hidden rounded-xl bg-muted/50 md:w-1/3 md:max-w-sm">
|
||||
<ShowPicture show={show()}/>
|
||||
</div>
|
||||
<div class="w-full md:w-1/4 flex-auto rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full flex-auto rounded-xl bg-muted/50 p-4 md:w-1/4">
|
||||
<p class="leading-7 [&:not(:first-child)]:mt-6">
|
||||
{show().overview}
|
||||
</p>
|
||||
</div>
|
||||
<div class="w-full md:w-1/3 flex-auto rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full flex-auto rounded-xl bg-muted/50 p-4 md:w-1/3">
|
||||
<Table.Root>
|
||||
<Table.Caption>A list of all downloaded/downloading versions of this season.</Table.Caption>
|
||||
<Table.Header>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {env} from '$env/dynamic/public';
|
||||
import type {PageLoad} from './$types';
|
||||
import {browser} from "$app/environment";
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
|
||||
@@ -8,7 +7,6 @@ export const load: PageLoad = async ({fetch, params}) => {
|
||||
const url = `${apiUrl}/tv/seasons/${params.SeasonId}/files`;
|
||||
const url2 = `${apiUrl}/tv/seasons/${params.SeasonId}`;
|
||||
|
||||
|
||||
try {
|
||||
console.log(`Fetching data from: ${url} and ${url2}`);
|
||||
const response = await fetch(url, {
|
||||
@@ -30,7 +28,6 @@ export const load: PageLoad = async ({fetch, params}) => {
|
||||
console.error(`API request failed with status ${response.status}: ${errorText}`);
|
||||
}
|
||||
|
||||
|
||||
const filesData = await response.json();
|
||||
const seasonData = await response2.json();
|
||||
console.log('received season_files data: ', filesData);
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
import * as RadioGroup from '$lib/components/ui/radio-group/index.js';
|
||||
import AddShowCard from '$lib/components/add-show-card.svelte';
|
||||
import {toast} from 'svelte-sonner';
|
||||
import {browser} from "$app/environment";
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
let searchTerm: string = $state('');
|
||||
let metadataProvider: string = $state('tmdb');
|
||||
let results: MetaDataProviderShowSearchResult[] | null = $state(null);
|
||||
@@ -80,7 +79,7 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="flex w-full flex-1 max-w-[90vw] flex-col items-center gap-4 p-4 pt-0">
|
||||
<div class="flex w-full max-w-[90vw] flex-1 flex-col items-center gap-4 p-4 pt-0">
|
||||
<div class="grid w-full max-w-sm items-center gap-12">
|
||||
<h1 class="scroll-m-20 text-center text-4xl font-extrabold tracking-tight lg:text-5xl">
|
||||
Add a show
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {env} from '$env/dynamic/public';
|
||||
import type {LayoutLoad} from './$types';
|
||||
import {browser} from "$app/environment";
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
export const load: LayoutLoad = async ({fetch}) => {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import {page} from '$app/state';
|
||||
import {Separator} from '$lib/components/ui/separator/index.js';
|
||||
import {page} from '$app/state';
|
||||
import {Separator} from '$lib/components/ui/separator/index.js';
|
||||
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
|
||||
import * as Breadcrumb from '$lib/components/ui/breadcrumb/index.js';
|
||||
import type {RichShowTorrent} from '$lib/types';
|
||||
import {getFullyQualifiedShowName} from '$lib/utils';
|
||||
import type {RichShowTorrent} from '$lib/types';
|
||||
import {getFullyQualifiedShowName} from '$lib/utils';
|
||||
import * as Accordion from '$lib/components/ui/accordion/index.js';
|
||||
import * as Card from '$lib/components/ui/card/index.js';
|
||||
import TorrentTable from '$lib/components/torrent-table.svelte';
|
||||
@@ -14,22 +14,22 @@
|
||||
|
||||
<header class="flex h-16 shrink-0 items-center gap-2">
|
||||
<div class="flex items-center gap-2 px-4">
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Sidebar.Trigger class="-ml-1"/>
|
||||
<Separator class="mr-2 h-4" orientation="vertical"/>
|
||||
<Breadcrumb.Root>
|
||||
<Breadcrumb.List>
|
||||
<Breadcrumb.Item class="hidden md:block">
|
||||
<Breadcrumb.Link href="/dashboard">MediaManager</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Link href="/dashboard">Home</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Link href="/dashboard/tv">Shows</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Page>TV Torrents</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
@@ -55,14 +55,12 @@
|
||||
</Card.Title>
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
<TorrentTable torrents={show.torrents}/>
|
||||
<TorrentTable torrents={show.torrents}/>
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="col-span-full text-center text-muted-foreground">
|
||||
No Torrents added yet.
|
||||
</div>
|
||||
<div class="col-span-full text-center text-muted-foreground">No Torrents added yet.</div>
|
||||
{/each}
|
||||
</Accordion.Root>
|
||||
{/await}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {env} from '$env/dynamic/public';
|
||||
import type {PageLoad} from './$types';
|
||||
import {browser} from "$app/environment";
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
|
||||
@@ -9,5 +8,5 @@ export const load: PageLoad = async ({fetch}) => {
|
||||
method: 'GET',
|
||||
credentials: 'include'
|
||||
});
|
||||
return {shows: response.json()};
|
||||
return {shows: response.json()};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {env} from '$env/dynamic/public';
|
||||
import type {PageLoad} from './$types';
|
||||
import {browser} from "$app/environment";
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user