diff --git a/web/src/lib/components/library-combobox.svelte b/web/src/lib/components/library-combobox.svelte new file mode 100644 index 0000000..90260e5 --- /dev/null +++ b/web/src/lib/components/library-combobox.svelte @@ -0,0 +1,127 @@ + + + + + {#snippet child({ props })} + + {/snippet} + + + + + + No library found. + + {#each libraries as item (item.name)} + { + value = item.name; + handleSelect(); + closeAndFocusTrigger(); + }} + > + + {item.name} + + {/each} + + + + + diff --git a/web/src/lib/components/ui/command/command-dialog.svelte b/web/src/lib/components/ui/command/command-dialog.svelte new file mode 100644 index 0000000..e128dbc --- /dev/null +++ b/web/src/lib/components/ui/command/command-dialog.svelte @@ -0,0 +1,35 @@ + + + + + + + diff --git a/web/src/lib/components/ui/command/command-empty.svelte b/web/src/lib/components/ui/command/command-empty.svelte new file mode 100644 index 0000000..8236a66 --- /dev/null +++ b/web/src/lib/components/ui/command/command-empty.svelte @@ -0,0 +1,12 @@ + + + diff --git a/web/src/lib/components/ui/command/command-group.svelte b/web/src/lib/components/ui/command/command-group.svelte new file mode 100644 index 0000000..e26a444 --- /dev/null +++ b/web/src/lib/components/ui/command/command-group.svelte @@ -0,0 +1,29 @@ + + + + {#if heading} + + {heading} + + {/if} + + diff --git a/web/src/lib/components/ui/command/command-input.svelte b/web/src/lib/components/ui/command/command-input.svelte new file mode 100644 index 0000000..b0fbfd4 --- /dev/null +++ b/web/src/lib/components/ui/command/command-input.svelte @@ -0,0 +1,25 @@ + + +
+ + +
diff --git a/web/src/lib/components/ui/command/command-item.svelte b/web/src/lib/components/ui/command/command-item.svelte new file mode 100644 index 0000000..edd265d --- /dev/null +++ b/web/src/lib/components/ui/command/command-item.svelte @@ -0,0 +1,19 @@ + + + diff --git a/web/src/lib/components/ui/command/command-link-item.svelte b/web/src/lib/components/ui/command/command-link-item.svelte new file mode 100644 index 0000000..06194f7 --- /dev/null +++ b/web/src/lib/components/ui/command/command-link-item.svelte @@ -0,0 +1,19 @@ + + + diff --git a/web/src/lib/components/ui/command/command-list.svelte b/web/src/lib/components/ui/command/command-list.svelte new file mode 100644 index 0000000..2fdc5ea --- /dev/null +++ b/web/src/lib/components/ui/command/command-list.svelte @@ -0,0 +1,16 @@ + + + diff --git a/web/src/lib/components/ui/command/command-separator.svelte b/web/src/lib/components/ui/command/command-separator.svelte new file mode 100644 index 0000000..d1f1a24 --- /dev/null +++ b/web/src/lib/components/ui/command/command-separator.svelte @@ -0,0 +1,12 @@ + + + diff --git a/web/src/lib/components/ui/command/command-shortcut.svelte b/web/src/lib/components/ui/command/command-shortcut.svelte new file mode 100644 index 0000000..4135b29 --- /dev/null +++ b/web/src/lib/components/ui/command/command-shortcut.svelte @@ -0,0 +1,20 @@ + + + + {@render children?.()} + diff --git a/web/src/lib/components/ui/command/command.svelte b/web/src/lib/components/ui/command/command.svelte new file mode 100644 index 0000000..bebb9b7 --- /dev/null +++ b/web/src/lib/components/ui/command/command.svelte @@ -0,0 +1,21 @@ + + + diff --git a/web/src/lib/components/ui/command/index.ts b/web/src/lib/components/ui/command/index.ts new file mode 100644 index 0000000..a8f4e74 --- /dev/null +++ b/web/src/lib/components/ui/command/index.ts @@ -0,0 +1,40 @@ +import { Command as CommandPrimitive } from 'bits-ui'; + +import Root from './command.svelte'; +import Dialog from './command-dialog.svelte'; +import Empty from './command-empty.svelte'; +import Group from './command-group.svelte'; +import Item from './command-item.svelte'; +import Input from './command-input.svelte'; +import List from './command-list.svelte'; +import Separator from './command-separator.svelte'; +import Shortcut from './command-shortcut.svelte'; +import LinkItem from './command-link-item.svelte'; + +const Loading: typeof CommandPrimitive.Loading = CommandPrimitive.Loading; + +export { + Root, + Dialog, + Empty, + Group, + Item, + LinkItem, + Input, + List, + Separator, + Shortcut, + Loading, + // + Root as Command, + Dialog as CommandDialog, + Empty as CommandEmpty, + Group as CommandGroup, + Item as CommandItem, + LinkItem as CommandLinkItem, + Input as CommandInput, + List as CommandList, + Separator as CommandSeparator, + Shortcut as CommandShortcut, + Loading as CommandLoading +}; diff --git a/web/src/lib/components/ui/popover/index.ts b/web/src/lib/components/ui/popover/index.ts new file mode 100644 index 0000000..5db432e --- /dev/null +++ b/web/src/lib/components/ui/popover/index.ts @@ -0,0 +1,17 @@ +import { Popover as PopoverPrimitive } from 'bits-ui'; +import Content from './popover-content.svelte'; +const Root = PopoverPrimitive.Root; +const Trigger = PopoverPrimitive.Trigger; +const Close = PopoverPrimitive.Close; + +export { + Root, + Content, + Trigger, + Close, + // + Root as Popover, + Content as PopoverContent, + Trigger as PopoverTrigger, + Close as PopoverClose +}; diff --git a/web/src/lib/components/ui/popover/popover-content.svelte b/web/src/lib/components/ui/popover/popover-content.svelte new file mode 100644 index 0000000..583ed09 --- /dev/null +++ b/web/src/lib/components/ui/popover/popover-content.svelte @@ -0,0 +1,28 @@ + + + + + diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts index a2b5346..47541a0 100644 --- a/web/src/lib/types.ts +++ b/web/src/lib/types.ts @@ -115,7 +115,6 @@ export interface Show { continuous_download: boolean; ended: boolean; library: string; - } export interface PublicShow { @@ -129,7 +128,6 @@ export interface PublicShow { continuous_download: boolean; ended: boolean; library: string; - } export interface Movie { @@ -151,7 +149,6 @@ export interface PublicMovie { id: string; // type: string, format: uuid downloaded: boolean; library: string; - } export interface Torrent { @@ -240,7 +237,7 @@ export interface SeasonRequest extends SeasonRequestBase { show: Show; } -export interface LibraryItem{ +export interface LibraryItem { name: string; - path: string -} \ No newline at end of file + path: string; +} diff --git a/web/src/routes/dashboard/movies/[movieId=uuid]/+page.svelte b/web/src/routes/dashboard/movies/[movieId=uuid]/+page.svelte index 250026f..5d4c05b 100644 --- a/web/src/routes/dashboard/movies/[movieId=uuid]/+page.svelte +++ b/web/src/routes/dashboard/movies/[movieId=uuid]/+page.svelte @@ -11,6 +11,8 @@ 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 LibraryCombobox from '$lib/components/library-combobox.svelte'; + import { Label } from '$lib/components/ui/label'; let movie: PublicMovie = page.data.movie; let user: () => User = getContext('user'); @@ -75,6 +77,11 @@
{#if user().is_superuser} +
+ + +
+
{/if} diff --git a/web/src/routes/dashboard/tv/[showId=uuid]/+page.svelte b/web/src/routes/dashboard/tv/[showId=uuid]/+page.svelte index 2393fc2..a3b58f6 100644 --- a/web/src/routes/dashboard/tv/[showId=uuid]/+page.svelte +++ b/web/src/routes/dashboard/tv/[showId=uuid]/+page.svelte @@ -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 { PublicShow, RichShowTorrent, Show, User } from '$lib/types.js'; + import type { PublicShow, RichShowTorrent, 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'; @@ -18,9 +18,9 @@ import { Checkbox } from '$lib/components/ui/checkbox/index.js'; import { toast } from 'svelte-sonner'; import { Label } from '$lib/components/ui/label'; - + import LibraryCombobox from '$lib/components/library-combobox.svelte'; const apiUrl = env.PUBLIC_API_URL; - let show: () => Show = getContext('show'); + let show: () => PublicShow = getContext('show'); let user: () => User = getContext('user'); let torrents: RichShowTorrent = page.data.torrentsData; @@ -120,9 +120,15 @@
{/if} +
+ + +
+
+
{/if} - +
@@ -146,7 +152,7 @@ > {season.number} - + {season.name} {season.overview}