From 5bc1e5e44bb3b35233e97eb604046abae16ac205 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Sun, 12 Jul 2026 15:11:50 +0200 Subject: [PATCH] frontend: align types to backend, playout HLS, rm Jellyfin proxy (#12) --- .../components/access-settings-editor.tsx | 28 +----- .../components/algorithmic-filter-editor.tsx | 3 + .../components/create-channel-dialog.tsx | 23 +---- .../components/edit-channel-sheet.tsx | 32 ++++--- .../components/import-channel-dialog.tsx | 10 +-- ...-editor.tsx => rotation-policy-editor.tsx} | 16 ++-- .../dashboard/components/schedule-sheet.tsx | 10 +-- k-tv-frontend/app/(main)/dashboard/page.tsx | 11 +-- k-tv-frontend/app/(main)/docs/page.tsx | 50 ++++------- .../(main)/tv/components/logo-watermark.tsx | 6 +- k-tv-frontend/app/(main)/tv/page.tsx | 18 +--- .../app/api/stream/[channelId]/route.ts | 67 -------------- k-tv-frontend/app/page.tsx | 2 +- k-tv-frontend/hooks/use-channel-form.ts | 14 +-- k-tv-frontend/hooks/use-import-channel.ts | 2 +- k-tv-frontend/hooks/use-tv.ts | 69 +++----------- k-tv-frontend/lib/channel-export.ts | 2 +- k-tv-frontend/lib/schemas.ts | 10 +-- k-tv-frontend/lib/types.ts | 89 +++++++++---------- 19 files changed, 128 insertions(+), 334 deletions(-) rename k-tv-frontend/app/(main)/dashboard/components/{recycle-policy-editor.tsx => rotation-policy-editor.tsx} (87%) delete mode 100644 k-tv-frontend/app/api/stream/[channelId]/route.ts diff --git a/k-tv-frontend/app/(main)/dashboard/components/access-settings-editor.tsx b/k-tv-frontend/app/(main)/dashboard/components/access-settings-editor.tsx index 948cda6..565c2b0 100644 --- a/k-tv-frontend/app/(main)/dashboard/components/access-settings-editor.tsx +++ b/k-tv-frontend/app/(main)/dashboard/components/access-settings-editor.tsx @@ -12,12 +12,8 @@ interface AccessSettingsEditorProps { export function AccessSettingsEditor({ accessMode, - accessPassword, onAccessModeChange, - onAccessPasswordChange, label = "Access", - passwordLabel = "Password", - passwordHint = "Leave blank to keep existing password", }: AccessSettingsEditorProps) { return (
@@ -25,33 +21,13 @@ export function AccessSettingsEditor({
- - {accessMode === "password_protected" && ( -
- - onAccessPasswordChange(e.target.value)} - className="w-full rounded-md border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-500 focus:outline-none" - /> -
- )} ); } diff --git a/k-tv-frontend/app/(main)/dashboard/components/algorithmic-filter-editor.tsx b/k-tv-frontend/app/(main)/dashboard/components/algorithmic-filter-editor.tsx index a32a135..e26a2fa 100644 --- a/k-tv-frontend/app/(main)/dashboard/components/algorithmic-filter-editor.tsx +++ b/k-tv-frontend/app/(main)/dashboard/components/algorithmic-filter-editor.tsx @@ -176,6 +176,9 @@ export function AlgorithmicFilterEditor({ + + + diff --git a/k-tv-frontend/app/(main)/dashboard/components/create-channel-dialog.tsx b/k-tv-frontend/app/(main)/dashboard/components/create-channel-dialog.tsx index fd2d166..3804f10 100644 --- a/k-tv-frontend/app/(main)/dashboard/components/create-channel-dialog.tsx +++ b/k-tv-frontend/app/(main)/dashboard/components/create-channel-dialog.tsx @@ -19,7 +19,6 @@ interface CreateChannelDialogProps { timezone: string; description: string; access_mode?: AccessMode; - access_password?: string; }) => void; isPending: boolean; error?: string | null; @@ -36,7 +35,6 @@ export function CreateChannelDialog({ const [timezone, setTimezone] = useState("UTC"); const [description, setDescription] = useState(""); const [accessMode, setAccessMode] = useState("public"); - const [accessPassword, setAccessPassword] = useState(""); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); @@ -45,7 +43,6 @@ export function CreateChannelDialog({ timezone, description, access_mode: accessMode !== "public" ? accessMode : undefined, - access_password: accessMode === "password_protected" && accessPassword ? accessPassword : undefined, }); }; @@ -57,7 +54,6 @@ export function CreateChannelDialog({ setTimezone("UTC"); setDescription(""); setAccessMode("public"); - setAccessPassword(""); } } }; @@ -120,25 +116,10 @@ export function CreateChannelDialog({ className="w-full rounded-md border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-100 focus:border-zinc-500 focus:outline-none" > - - - + - {accessMode === "password_protected" && ( -
- - setAccessPassword(e.target.value)} - placeholder="Channel password" - className="w-full rounded-md border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-500 focus:outline-none" - /> -
- )} - {error &&

{error}

} @@ -151,7 +132,7 @@ export function CreateChannelDialog({ Cancel diff --git a/k-tv-frontend/app/(main)/dashboard/components/edit-channel-sheet.tsx b/k-tv-frontend/app/(main)/dashboard/components/edit-channel-sheet.tsx index 60dbfd0..675797d 100644 --- a/k-tv-frontend/app/(main)/dashboard/components/edit-channel-sheet.tsx +++ b/k-tv-frontend/app/(main)/dashboard/components/edit-channel-sheet.tsx @@ -11,7 +11,7 @@ import { import { Button } from "@/components/ui/button"; import { BlockTimeline, BLOCK_COLORS } from "./block-timeline"; import { AlgorithmicFilterEditor } from "./algorithmic-filter-editor"; -import { RecyclePolicyEditor } from "./recycle-policy-editor"; +import { RotationPolicyEditor } from "./rotation-policy-editor"; import { WebhookEditor } from "./webhook-editor"; import { AccessSettingsEditor } from "./access-settings-editor"; import { LogoEditor } from "./logo-editor"; @@ -27,7 +27,7 @@ import type { FillStrategy, MediaFilter, ProviderInfo, - RecyclePolicy, + RotationPolicy, Weekday, } from "@/lib/types"; import { WEEKDAYS, WEEKDAY_LABELS } from "@/lib/types"; @@ -261,9 +261,9 @@ function BlockEditor({ block, index, errors, providers, onChange }: BlockEditorP