mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-20 06:54:21 +02:00
edit frontend code to pass ci/cd checks
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import AppSidebar from '$lib/components/app-sidebar.svelte';
|
||||
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
|
||||
import type {LayoutProps} from './$types';
|
||||
import {setContext} from 'svelte';
|
||||
import {goto} from '$app/navigation';
|
||||
import {base} from '$app/paths';
|
||||
import {toast} from 'svelte-sonner';
|
||||
import type {LayoutProps} from './$types';
|
||||
import {setContext} from 'svelte';
|
||||
import {goto} from '$app/navigation';
|
||||
import {base} from '$app/paths';
|
||||
import {toast} from 'svelte-sonner';
|
||||
|
||||
let {data, children}: LayoutProps = $props();
|
||||
let {data, children}: LayoutProps = $props();
|
||||
console.log('Received User Data: ', data.user);
|
||||
if (!data.user.is_verified) {
|
||||
toast.info('Your account requires verification. Redirecting...');
|
||||
@@ -17,7 +17,7 @@
|
||||
</script>
|
||||
|
||||
<Sidebar.Provider>
|
||||
<AppSidebar/>
|
||||
<AppSidebar/>
|
||||
<Sidebar.Inset>
|
||||
{@render children()}
|
||||
</Sidebar.Inset>
|
||||
|
||||
@@ -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,36 +1,37 @@
|
||||
<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 RecommendedMediaCarousel from '$lib/components/recommended-media-carousel.svelte';
|
||||
import {base} from '$app/paths';
|
||||
import {onMount} from 'svelte';
|
||||
import {env} from '$env/dynamic/public';
|
||||
import {base} from '$app/paths';
|
||||
import {onMount} from 'svelte';
|
||||
import {env} from '$env/dynamic/public';
|
||||
import {MetaDataProviderSearchResult} from '$lib/types';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
|
||||
let recommendedShows: any[] = [];
|
||||
let recommendedShows: MetaDataProviderSearchResult[] = [];
|
||||
let showsLoading = true;
|
||||
|
||||
let recommendedMovies: any[] = [];
|
||||
let recommendedMovies: MetaDataProviderSearchResult[] = [];
|
||||
let moviesLoading = true;
|
||||
|
||||
onMount(async () => {
|
||||
const showsRes = await fetch(apiUrl + '/tv/recommended', {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json'
|
||||
Accept: 'application/json'
|
||||
},
|
||||
credentials: 'include',
|
||||
method: 'GET'
|
||||
});
|
||||
recommendedShows = await showsRes.json();
|
||||
showsLoading = false;
|
||||
showsLoading = false;
|
||||
|
||||
const moviesRes = await fetch(apiUrl + '/movies/recommended', {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json'
|
||||
Accept: 'application/json'
|
||||
},
|
||||
credentials: 'include',
|
||||
method: 'GET'
|
||||
@@ -42,14 +43,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>Home</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
@@ -62,16 +63,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-[70vw] md:max-w-[80vw]">
|
||||
<h3 class="my-4 text-center text-2xl font-semibold">Trending Shows</h3>
|
||||
<RecommendedMediaCarousel isLoading={showsLoading} isShow={true} media={recommendedShows}/>
|
||||
<div class="mx-auto max-w-[70vw] md:max-w-[80vw]">
|
||||
<h3 class="my-4 text-center text-2xl font-semibold">Trending Shows</h3>
|
||||
<RecommendedMediaCarousel isLoading={showsLoading} isShow={true} media={recommendedShows}/>
|
||||
|
||||
<h3 class="my-4 text-center text-2xl font-semibold">Trending Movies</h3>
|
||||
<RecommendedMediaCarousel
|
||||
isLoading={moviesLoading}
|
||||
isShow={false}
|
||||
media={recommendedMovies}
|
||||
/>
|
||||
<h3 class="my-4 text-center text-2xl font-semibold">Trending Movies</h3>
|
||||
<RecommendedMediaCarousel
|
||||
isLoading={moviesLoading}
|
||||
isShow={false}
|
||||
media={recommendedMovies}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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,86 +1,84 @@
|
||||
<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 {ImageOff} from 'lucide-svelte';
|
||||
import {getContext} from 'svelte';
|
||||
import type {PublicMovie, RichShowTorrent, User} from '$lib/types.js';
|
||||
import {getFullyQualifiedMediaName} from '$lib/utils';
|
||||
import {page} from '$app/state';
|
||||
import TorrentTable from '$lib/components/torrent-table.svelte';
|
||||
import MediaPicture from '$lib/components/media-picture.svelte';
|
||||
import DownloadMovieDialog from '$lib/components/download-movie-dialog.svelte';
|
||||
import RequestMovieDialog from '$lib/components/request-movie-dialog.svelte';
|
||||
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 {ImageOff} from 'lucide-svelte';
|
||||
import {getContext} from 'svelte';
|
||||
import type {PublicMovie, RichShowTorrent, User} from '$lib/types.js';
|
||||
import {getFullyQualifiedMediaName} from '$lib/utils';
|
||||
import {page} from '$app/state';
|
||||
import TorrentTable from '$lib/components/torrent-table.svelte';
|
||||
import MediaPicture from '$lib/components/media-picture.svelte';
|
||||
import DownloadMovieDialog from '$lib/components/download-movie-dialog.svelte';
|
||||
import RequestMovieDialog from '$lib/components/request-movie-dialog.svelte';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
let movie: PublicMovie = page.data.movie;
|
||||
let user: () => User = getContext('user');
|
||||
let torrents: RichShowTorrent = page.data.torrents;
|
||||
let movie: PublicMovie = page.data.movie;
|
||||
let user: () => User = getContext('user');
|
||||
let torrents: RichShowTorrent = page.data.torrents;
|
||||
</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/movies">Movies</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Page>{getFullyQualifiedMediaName(movie)}</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/movies">Movies</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Page>{getFullyQualifiedMediaName(movie)}</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">
|
||||
{getFullyQualifiedMediaName(movie)}
|
||||
{getFullyQualifiedMediaName(movie)}
|
||||
</h1>
|
||||
<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 movie.id}
|
||||
<MediaPicture media={movie}/>
|
||||
{: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">
|
||||
{movie.overview}
|
||||
</p>
|
||||
</div>
|
||||
<div class="w-full flex-auto rounded-xl bg-muted/50 p-4 md:w-1/3">
|
||||
{#if user().is_superuser}
|
||||
<DownloadMovieDialog {movie}/>
|
||||
<div class="my-4"></div>
|
||||
{/if}
|
||||
<RequestMovieDialog {movie}/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="flex-1 rounded-xl bg-muted/50 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 movie.id}
|
||||
<MediaPicture media={movie}/>
|
||||
{: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">
|
||||
{movie.overview}
|
||||
</p>
|
||||
</div>
|
||||
<div class="w-full flex-auto rounded-xl bg-muted/50 p-4 md:w-1/3">
|
||||
{#if user().is_superuser}
|
||||
<DownloadMovieDialog {movie}/>
|
||||
<div class="my-4"></div>
|
||||
{/if}
|
||||
<RequestMovieDialog {movie}/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<TorrentTable isShow={false} torrents={torrents.torrents}/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<TorrentTable isShow={false} torrents={torrents.torrents}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import {Button} from '$lib/components/ui/button';
|
||||
import {ChevronDown} from 'lucide-svelte';
|
||||
import * as Collapsible from '$lib/components/ui/collapsible/index.js';
|
||||
import type {MetaDataProviderShowSearchResult} from '$lib/types.js';
|
||||
import type {MetaDataProviderSearchResult} from '$lib/types.js';
|
||||
import * as RadioGroup from '$lib/components/ui/radio-group/index.js';
|
||||
import AddMediaCard from '$lib/components/add-media-card.svelte';
|
||||
import {toast} from 'svelte-sonner';
|
||||
@@ -17,7 +17,7 @@
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
let searchTerm: string = $state('');
|
||||
let metadataProvider: string = $state('tmdb');
|
||||
let results: MetaDataProviderShowSearchResult[] | null = $state(null);
|
||||
let results: MetaDataProviderSearchResult[] | null = $state(null);
|
||||
onMount(search);
|
||||
|
||||
async function search() {
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import {env} from '$env/dynamic/public';
|
||||
import type {PageLoad} from './$types';
|
||||
|
||||
const apiUrl = env.PUBLIC_API_URL;
|
||||
|
||||
export const load: PageLoad = async ({fetch}) => {
|
||||
};
|
||||
@@ -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,30 +1,30 @@
|
||||
<script lang="ts">
|
||||
import {page} from '$app/state';
|
||||
import {page} from '$app/state';
|
||||
import * as Card from '$lib/components/ui/card/index.js';
|
||||
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 {getFullyQualifiedMediaName} from '$lib/utils';
|
||||
import {getFullyQualifiedMediaName} from '$lib/utils';
|
||||
import MediaPicture from '$lib/components/media-picture.svelte';
|
||||
import {Skeleton} from '$lib/components/ui/skeleton';
|
||||
import {Skeleton} from '$lib/components/ui/skeleton';
|
||||
|
||||
let tvShowsPromise = page.data.tvShows;
|
||||
</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="/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.Page>Shows</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
@@ -33,24 +33,24 @@
|
||||
</div>
|
||||
</header>
|
||||
{#snippet loadingbar()}
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
<Skeleton class="h-[50vh] w-full "/>
|
||||
{/snippet}
|
||||
<div class="flex w-full flex-1 flex-col gap-4 p-4 pt-0">
|
||||
<h1 class="scroll-m-20 text-center text-4xl font-extrabold tracking-tight lg:text-5xl">
|
||||
TV Shows
|
||||
</h1>
|
||||
<div
|
||||
class="grid w-full auto-rows-min gap-4 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5"
|
||||
class="grid w-full auto-rows-min gap-4 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5"
|
||||
>
|
||||
{#await tvShowsPromise}
|
||||
{@render loadingbar()}
|
||||
@@ -66,7 +66,7 @@
|
||||
<Card.Description class="truncate">{show.overview}</Card.Description>
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
<MediaPicture media={show}/>
|
||||
<MediaPicture media={show}/>
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
</a>
|
||||
|
||||
@@ -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,23 +1,23 @@
|
||||
<script lang="ts">
|
||||
import {env} from '$env/dynamic/public';
|
||||
import {Separator} from '$lib/components/ui/separator/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 {goto} from '$app/navigation';
|
||||
import {ImageOff} from 'lucide-svelte';
|
||||
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 {getFullyQualifiedMediaName} from '$lib/utils';
|
||||
import {getContext} from 'svelte';
|
||||
import type {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';
|
||||
import {page} from '$app/state';
|
||||
import {page} from '$app/state';
|
||||
import TorrentTable from '$lib/components/torrent-table.svelte';
|
||||
import RequestSeasonDialog from '$lib/components/request-season-dialog.svelte';
|
||||
import MediaPicture from '$lib/components/media-picture.svelte';
|
||||
import {Checkbox} from '$lib/components/ui/checkbox/index.js';
|
||||
import {toast} from 'svelte-sonner';
|
||||
import {Label} from '$lib/components/ui/label';
|
||||
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');
|
||||
@@ -28,10 +28,10 @@
|
||||
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
|
||||
'Toggling continuous download for show',
|
||||
show().name,
|
||||
'to',
|
||||
!show().continuous_download
|
||||
);
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
@@ -49,22 +49,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>{getFullyQualifiedMediaName(show())}</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
@@ -79,12 +79,12 @@
|
||||
<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}
|
||||
<MediaPicture media={show()}/>
|
||||
<MediaPicture media={show()}/>
|
||||
{:else}
|
||||
<div
|
||||
class="aspect-9/16 flex h-auto w-full items-center justify-center rounded-lg bg-gray-200 text-gray-500"
|
||||
class="aspect-9/16 flex h-auto w-full items-center justify-center rounded-lg bg-gray-200 text-gray-500"
|
||||
>
|
||||
<ImageOff size={48}/>
|
||||
<ImageOff size={48}/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -98,21 +98,21 @@
|
||||
{#if !show().ended}
|
||||
<div class="mx-1 my-2 block">
|
||||
<Checkbox
|
||||
checked={show().continuous_download}
|
||||
onCheckedChange={() => {
|
||||
checked={show().continuous_download}
|
||||
onCheckedChange={() => {
|
||||
toggle_continuous_download();
|
||||
}}
|
||||
id="continuous-download-checkbox"
|
||||
id="continuous-download-checkbox"
|
||||
/>
|
||||
<Label for="continuous-download-checkbox">
|
||||
Enable automatic download of future seasons
|
||||
</Label>
|
||||
<hr/>
|
||||
<hr/>
|
||||
</div>
|
||||
{/if}
|
||||
<DownloadSeasonDialog show={show()}/>
|
||||
<DownloadSeasonDialog show={show()}/>
|
||||
{/if}
|
||||
<RequestSeasonDialog show={show()}/>
|
||||
<RequestSeasonDialog show={show()}/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
@@ -131,12 +131,12 @@
|
||||
{#if show().seasons.length > 0}
|
||||
{#each show().seasons as season (season.id)}
|
||||
<Table.Row
|
||||
link={true}
|
||||
onclick={() => goto('/dashboard/tv/' + show().id + '/' + season.id)}
|
||||
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}/>
|
||||
<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>
|
||||
@@ -153,7 +153,7 @@
|
||||
</div>
|
||||
<div class="flex-1 rounded-xl bg-muted/50 p-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<TorrentTable torrents={torrents.torrents}/>
|
||||
<TorrentTable torrents={torrents.torrents}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<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 * as Table from '$lib/components/ui/table/index.js';
|
||||
import {getContext} from 'svelte';
|
||||
import type {PublicSeasonFile, Season, Show} from '$lib/types';
|
||||
import {getContext} from 'svelte';
|
||||
import type {PublicSeasonFile, Season, Show} from '$lib/types';
|
||||
import CheckmarkX from '$lib/components/checkmark-x.svelte';
|
||||
import {getFullyQualifiedMediaName, getTorrentQualityString} from '$lib/utils';
|
||||
import {getFullyQualifiedMediaName, getTorrentQualityString} from '$lib/utils';
|
||||
import MediaPicture from '$lib/components/media-picture.svelte';
|
||||
|
||||
let seasonFiles: PublicSeasonFile[] = $state(page.data.files);
|
||||
@@ -19,29 +19,29 @@
|
||||
|
||||
<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.Link href="/dashboard/tv/{show().id}">
|
||||
{show().name}
|
||||
{show().year == null ? '' : '(' + show().year + ')'}
|
||||
</Breadcrumb.Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Separator class="hidden md:block"/>
|
||||
<Breadcrumb.Item>
|
||||
<Breadcrumb.Page>Season {season.number}</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="flex 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">
|
||||
<MediaPicture media={show()}/>
|
||||
<MediaPicture media={show()}/>
|
||||
</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">
|
||||
@@ -82,7 +82,7 @@
|
||||
{file.file_path_suffix}
|
||||
</Table.Cell>
|
||||
<Table.Cell class="w-[10px] font-medium">
|
||||
<CheckmarkX state={file.downloaded}/>
|
||||
<CheckmarkX state={file.downloaded}/>
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
{:else}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<script lang="ts">
|
||||
import {env} from '$env/dynamic/public';
|
||||
import {Separator} from '$lib/components/ui/separator/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 {Input} from '$lib/components/ui/input';
|
||||
import {Label} from '$lib/components/ui/label';
|
||||
import {Button} from '$lib/components/ui/button';
|
||||
import {ChevronDown} from 'lucide-svelte';
|
||||
import {Input} from '$lib/components/ui/input';
|
||||
import {Label} from '$lib/components/ui/label';
|
||||
import {Button} from '$lib/components/ui/button';
|
||||
import {ChevronDown} from 'lucide-svelte';
|
||||
import * as Collapsible from '$lib/components/ui/collapsible/index.js';
|
||||
import type {MetaDataProviderShowSearchResult} from '$lib/types.js';
|
||||
import type {MetaDataProviderSearchResult} from '$lib/types.js';
|
||||
import * as RadioGroup from '$lib/components/ui/radio-group/index.js';
|
||||
import AddMediaCard from '$lib/components/add-media-card.svelte';
|
||||
import {toast} from 'svelte-sonner';
|
||||
import {onMount} from 'svelte';
|
||||
import {toast} from 'svelte-sonner';
|
||||
import {onMount} from 'svelte';
|
||||
|
||||
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);
|
||||
onMount(search);
|
||||
let results: MetaDataProviderSearchResult[] | null = $state(null);
|
||||
onMount(search);
|
||||
async function search() {
|
||||
let url = new URL(apiUrl + '/tv/recommended');
|
||||
if (searchTerm.length > 0) {
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
results = await response.json();
|
||||
if (searchTerm.length === 0) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
if (results && results.length > 0) {
|
||||
toast.success(`Found ${results.length} result(s) for "${searchTerm}".`);
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
} catch (error) {
|
||||
const errorMessage =
|
||||
error instanceof Error ? error.message : 'An unknown error occurred during search.';
|
||||
error instanceof Error ? error.message : 'An unknown error occurred during search.';
|
||||
console.error('Search error:', error);
|
||||
toast.error(errorMessage);
|
||||
results = null; // Clear previous results on error
|
||||
@@ -58,22 +58,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>Add a Show</Breadcrumb.Page>
|
||||
</Breadcrumb.Item>
|
||||
@@ -85,33 +85,33 @@
|
||||
<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
|
||||
Add a Show
|
||||
</h1>
|
||||
<section>
|
||||
<Label for="search-box">Show Name</Label>
|
||||
<Input bind:value={searchTerm} id="search-box" placeholder="Show Name" type="text"/>
|
||||
<Input bind:value={searchTerm} id="search-box" placeholder="Show Name" type="text"/>
|
||||
<p class="text-sm text-muted-foreground">Search for a Show to add.</p>
|
||||
</section>
|
||||
<section>
|
||||
<Collapsible.Root class="w-full space-y-1">
|
||||
<Collapsible.Root class="w-full space-y-1">
|
||||
<Collapsible.Trigger>
|
||||
<div class="flex items-center justify-between space-x-4 px-4">
|
||||
<h4 class="text-sm font-semibold">Advanced Settings</h4>
|
||||
<Button class="w-9 p-0" size="sm" variant="ghost">
|
||||
<ChevronDown/>
|
||||
<ChevronDown/>
|
||||
<span class="sr-only">Toggle</span>
|
||||
</Button>
|
||||
</div>
|
||||
</Collapsible.Trigger>
|
||||
<Collapsible.Content class="space-y-1">
|
||||
<Collapsible.Content class="space-y-1">
|
||||
<Label for="metadata-provider-selector">Choose which Metadata Provider to query.</Label>
|
||||
<RadioGroup.Root bind:value={metadataProvider} id="metadata-provider-selector">
|
||||
<div class="flex items-center space-x-2">
|
||||
<RadioGroup.Item id="option-one" value="tmdb"/>
|
||||
<RadioGroup.Item id="option-one" value="tmdb"/>
|
||||
<Label for="option-one">TMDB (Recommended)</Label>
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<RadioGroup.Item id="option-two" value="tvdb"/>
|
||||
<RadioGroup.Item id="option-two" value="tvdb"/>
|
||||
<Label for="option-two">TVDB</Label>
|
||||
</div>
|
||||
</RadioGroup.Root>
|
||||
@@ -123,18 +123,18 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<Separator class="my-8"/>
|
||||
<Separator class="my-8"/>
|
||||
|
||||
{#if results != null}
|
||||
{#if results.length === 0}
|
||||
<h3 class="mx-auto">No Shows found.</h3>
|
||||
{:else}
|
||||
<div
|
||||
class="grid w-full auto-rows-min gap-4 sm:grid-cols-1
|
||||
class="grid w-full auto-rows-min gap-4 sm:grid-cols-1
|
||||
md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5"
|
||||
>
|
||||
{#each results as result}
|
||||
<AddMediaCard {result}/>
|
||||
<AddMediaCard {result}/>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -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 {getFullyQualifiedMediaName} from '$lib/utils';
|
||||
import type {RichShowTorrent} from '$lib/types';
|
||||
import {getFullyQualifiedMediaName} 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>
|
||||
@@ -51,16 +51,16 @@
|
||||
<Card.Root>
|
||||
<Card.Header>
|
||||
<Card.Title>
|
||||
{getFullyQualifiedMediaName(show)}
|
||||
{getFullyQualifiedMediaName(show)}
|
||||
</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}
|
||||
|
||||
@@ -8,5 +8,5 @@ export const load: PageLoad = async ({fetch}) => {
|
||||
method: 'GET',
|
||||
credentials: 'include'
|
||||
});
|
||||
return {shows: response.json()};
|
||||
return {shows: response.json()};
|
||||
};
|
||||
|
||||
@@ -12,5 +12,5 @@ export const load: PageLoad = async ({fetch}) => {
|
||||
credentials: 'include'
|
||||
});
|
||||
|
||||
return {oauthProvider: await response.json()};
|
||||
return {oauthProvider: await response.json()};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user