From 66eef2c82e77481db6d3e2ea77e9156c045226a3 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Fri, 20 Mar 2026 01:18:34 +0100 Subject: [PATCH] feat(frontend): add useLibraryShows and useLibrarySeasons hooks --- k-tv-backend/api/src/routes/library.rs | 4 +++- .../library/components/schedule-from-library-dialog.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/k-tv-backend/api/src/routes/library.rs b/k-tv-backend/api/src/routes/library.rs index 1f1ba18..0687040 100644 --- a/k-tv-backend/api/src/routes/library.rs +++ b/k-tv-backend/api/src/routes/library.rs @@ -22,7 +22,7 @@ use axum::{ response::IntoResponse, routing::{get, post, put}, }; -use domain::{ContentType, ILibraryRepository, LibrarySearchFilter, LibrarySyncAdapter}; +use domain::{ContentType, ILibraryRepository, LibrarySearchFilter, LibrarySyncAdapter, SeasonSummary, ShowSummary}; use serde::{Deserialize, Serialize}; use crate::{error::ApiError, extractors::{AdminUser, CurrentUser}, state::AppState}; @@ -38,6 +38,8 @@ pub fn router() -> Router { .route("/genres", get(list_genres)) .route("/items", get(search_items)) .route("/items/:id", get(get_item)) + .route("/shows", get(list_shows)) + .route("/shows/:name/seasons", get(list_seasons)) .route("/sync/status", get(sync_status)) .route("/sync", post(trigger_sync)) } diff --git a/k-tv-frontend/app/(main)/library/components/schedule-from-library-dialog.tsx b/k-tv-frontend/app/(main)/library/components/schedule-from-library-dialog.tsx index 97ee782..b21210d 100644 --- a/k-tv-frontend/app/(main)/library/components/schedule-from-library-dialog.tsx +++ b/k-tv-frontend/app/(main)/library/components/schedule-from-library-dialog.tsx @@ -7,7 +7,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@ import { Input } from "@/components/ui/input"; import { Checkbox } from "@/components/ui/checkbox"; import { useChannels, useUpdateChannel } from "@/hooks/use-channels"; -import type { LibraryItemFull, Weekday, ProgrammingBlock, ScheduleConfig } from "@/lib/types"; +import type { LibraryItemFull, ShowSummary, Weekday, ProgrammingBlock, ScheduleConfig } from "@/lib/types"; import { WEEKDAYS, WEEKDAY_LABELS } from "@/lib/types"; interface Props {