From b776dbcf33a45c6f2f4337a9df6077babd93ffe0 Mon Sep 17 00:00:00 2001 From: Silo Server Migration Date: Sun, 24 May 2026 18:47:56 -0400 Subject: [PATCH] fix(web): format discover browse files --- web/src/components/BrandCard.tsx | 2 +- web/src/hooks/queries/keys.ts | 12 +----------- web/src/hooks/queries/requests.ts | 8 ++------ web/src/pages/RequestBrowse.tsx | 17 +++++++++++++---- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/web/src/components/BrandCard.tsx b/web/src/components/BrandCard.tsx index 518a2265..8441229f 100644 --- a/web/src/components/BrandCard.tsx +++ b/web/src/components/BrandCard.tsx @@ -37,7 +37,7 @@ export default function BrandCard({ aria-label={card.display_name} className={cn( "group relative flex h-20 w-[140px] flex-none items-center justify-center overflow-hidden rounded-lg shadow-sm", - "ring-1 ring-white/5 transition-colors hover:ring-white/30 focus:outline-none focus:ring-2 focus:ring-white", + "ring-1 ring-white/5 transition-colors hover:ring-white/30 focus:ring-2 focus:ring-white focus:outline-none", )} style={{ background }} > diff --git a/web/src/hooks/queries/keys.ts b/web/src/hooks/queries/keys.ts index 87d94fcf..c857ae6a 100644 --- a/web/src/hooks/queries/keys.ts +++ b/web/src/hooks/queries/keys.ts @@ -130,17 +130,7 @@ export const requestKeys = { mediaType: string | undefined, sort: string, page: number, - ) => - [ - "requests", - "discover", - "browse", - kind, - slug, - mediaType ?? "", - sort, - page, - ] as const, + ) => ["requests", "discover", "browse", kind, slug, mediaType ?? "", sort, page] as const, search: (mediaType: string, query: string, page: number) => ["requests", "search", mediaType, query, page] as const, detail: (mediaType: string, tmdbID: number) => ["requests", "detail", mediaType, tmdbID] as const, diff --git a/web/src/hooks/queries/requests.ts b/web/src/hooks/queries/requests.ts index b4422946..2c2f0f43 100644 --- a/web/src/hooks/queries/requests.ts +++ b/web/src/hooks/queries/requests.ts @@ -78,9 +78,7 @@ export function useDiscoverStudios() { return useQuery({ queryKey: requestKeys.discoverStudios(), queryFn: () => - api("/requests/discover/studios").then( - (data) => data.studios ?? [], - ), + api("/requests/discover/studios").then((data) => data.studios ?? []), staleTime: DISCOVER_BRAND_STALE_TIME, }); } @@ -100,9 +98,7 @@ export function useDiscoverGenres() { return useQuery({ queryKey: requestKeys.discoverGenres(), queryFn: () => - api("/requests/discover/genres").then( - (data) => data.genres ?? [], - ), + api("/requests/discover/genres").then((data) => data.genres ?? []), staleTime: DISCOVER_BRAND_STALE_TIME, }); } diff --git a/web/src/pages/RequestBrowse.tsx b/web/src/pages/RequestBrowse.tsx index e4da8f8f..0249aa12 100644 --- a/web/src/pages/RequestBrowse.tsx +++ b/web/src/pages/RequestBrowse.tsx @@ -42,7 +42,7 @@ export default function RequestBrowse({ kind }: RequestBrowseProps) { const page = Math.max(1, Number(searchParams.get("page") ?? "1") || 1); const mediaTypeFromQuery = normalizeMediaType(searchParams.get("media_type")); const mediaType: RequestMediaType | undefined = - kind === "studio" ? "movie" : kind === "network" ? "series" : mediaTypeFromQuery ?? "movie"; + kind === "studio" ? "movie" : kind === "network" ? "series" : (mediaTypeFromQuery ?? "movie"); const browse = useRequestBrowse({ kind, slug, mediaType, sort, page }); const createRequest = useCreateMediaRequest(); @@ -84,7 +84,10 @@ export default function RequestBrowse({ kind }: RequestBrowseProps) {

{kind === "studio" ? "Studio" : kind === "network" ? "Network" : "Genre"} not found.

- + Back to Requests @@ -175,7 +178,11 @@ export default function RequestBrowse({ kind }: RequestBrowseProps) { Page {page} of {totalPages} - @@ -234,7 +241,9 @@ function BrowseGridSkeleton() { } function normalizeSort(value: string | null): BrowseSort { - return SORT_OPTIONS.some((option) => option.value === value) ? (value as BrowseSort) : "popularity"; + return SORT_OPTIONS.some((option) => option.value === value) + ? (value as BrowseSort) + : "popularity"; } function normalizeMediaType(value: string | null): RequestMediaType | undefined {