diff --git a/react_frontend/src/components/entries/EntryCard.tsx b/react_frontend/src/components/entries/EntryCard.tsx index 6b1d814..c40e8a0 100644 --- a/react_frontend/src/components/entries/EntryCard.tsx +++ b/react_frontend/src/components/entries/EntryCard.tsx @@ -1,31 +1,49 @@ -import { useState } from 'react'; -import { Link, useNavigate } from 'react-router-dom'; +import { useState } from "react"; +import { Link, useNavigate } from "react-router-dom"; import { - Plus, Star, Loader2, Heart, EyeOff, Trash2, MoreHorizontal, X, - Eye, History, FolderPlus, RefreshCw, ImageIcon, Settings, -} from 'lucide-react'; -import { Badge } from '@/components/ui/badge'; -import { Button } from '@/components/ui/button'; -import { Skeleton } from '@/components/ui/skeleton'; + Plus, + Star, + Loader2, + Heart, + EyeOff, + Trash2, + MoreHorizontal, + X, + Eye, + History, + FolderPlus, + RefreshCw, + ImageIcon, + Settings, +} from "lucide-react"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { Skeleton } from "@/components/ui/skeleton"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, -} from '@/components/ui/dropdown-menu'; -import { getPosterUrl, getYear, formatRuntime } from '@/lib/media-utils'; -import { useCreateEntry, useDeleteEntry, useUpdateEntry, useRefreshEntry, useEntrySeasons } from '@/hooks/useEntries'; -import { useEntrySeenByEntry, useDeleteEntrySeen } from '@/hooks/useEntrySeen'; -import { useLibraryStore } from '@/stores/useLibraryStore'; -import { ConfirmDialog } from '@/components/dialogs/ConfirmDialog'; -import { EntrySeenDialog } from '@/components/dialogs/EntrySeenDialog'; -import { RatingDialog } from '@/components/dialogs/RatingDialog'; -import { MovieWatchHistoryDialog } from '@/components/dialogs/MovieWatchHistoryDialog'; -import { AddEntryToCollectionDialog } from '@/components/dialogs/AddEntryToCollectionDialog'; -import { EntryMediaDialog } from '@/components/dialogs/EntryMediaDialog'; -import { EntrySettingsDialog } from '@/components/dialogs/EntrySettingsDialog'; -import type { Entry, TmdbEntry } from '@/types'; +} from "@/components/ui/dropdown-menu"; +import { getPosterUrl, getYear, formatRuntime } from "@/lib/media-utils"; +import { + useCreateEntry, + useDeleteEntry, + useUpdateEntry, + useRefreshEntry, + useEntrySeasons, +} from "@/hooks/useEntries"; +import { useEntrySeenByEntry, useDeleteEntrySeen } from "@/hooks/useEntrySeen"; +import { useLibraryStore } from "@/stores/useLibraryStore"; +import { ConfirmDialog } from "@/components/dialogs/ConfirmDialog"; +import { EntrySeenDialog } from "@/components/dialogs/EntrySeenDialog"; +import { RatingDialog } from "@/components/dialogs/RatingDialog"; +import { MovieWatchHistoryDialog } from "@/components/dialogs/MovieWatchHistoryDialog"; +import { AddEntryToCollectionDialog } from "@/components/dialogs/AddEntryToCollectionDialog"; +import { EntryMediaDialog } from "@/components/dialogs/EntryMediaDialog"; +import { EntrySettingsDialog } from "@/components/dialogs/EntrySettingsDialog"; +import type { Entry, TmdbEntry } from "@/types"; interface EntryCardProps { entry?: Entry; @@ -37,15 +55,23 @@ interface EntryCardProps { onRemoveFromCollection?: (entryId: number) => void; } -export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRemoveFromCollection }: EntryCardProps) { +export function EntryCard({ + entry, + tmdbEntry, + showTypeBadge, + collectionId, + onRemoveFromCollection, +}: EntryCardProps) { const [showConfirm, setShowConfirm] = useState(false); - const [showRemoveCollectionConfirm, setShowRemoveCollectionConfirm] = useState(false); + const [showRemoveCollectionConfirm, setShowRemoveCollectionConfirm] = + useState(false); const [showSeenDialog, setShowSeenDialog] = useState(false); const [showRatingDialog, setShowRatingDialog] = useState(false); const [showWatchHistoryDialog, setShowWatchHistoryDialog] = useState(false); const [showCollectionDialog, setShowCollectionDialog] = useState(false); const [showMediaDialog, setShowMediaDialog] = useState(false); const [showSettingsDialog, setShowSettingsDialog] = useState(false); + const [dropdownOpen, setDropdownOpen] = useState(false); const navigate = useNavigate(); const createEntry = useCreateEntry(); const deleteEntry = useDeleteEntry(); @@ -66,7 +92,7 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem // Resolve display data const title = - displayEntry?.title || tmdbEntry?.title || tmdbEntry?.name || 'Untitled'; + displayEntry?.title || tmdbEntry?.title || tmdbEntry?.name || "Untitled"; const year = displayEntry ? getYear(displayEntry.release_date) : getYear(tmdbEntry?.release_date || tmdbEntry?.first_air_date || null); @@ -77,22 +103,22 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem const runtime = displayEntry && !displayEntry.is_tvseries ? formatRuntime(displayEntry.runtime) - : ''; + : ""; const isTv = displayEntry?.is_tvseries || - tmdbEntry?.media_type === 'tv' || + tmdbEntry?.media_type === "tv" || !!tmdbEntry?.name; const posterUrl = displayEntry ? getPosterUrl(displayEntry) : tmdbEntry?.poster_path ? `https://image.tmdb.org/t/p/w342${tmdbEntry.poster_path}` - : '/images/default-poster.png'; + : "/images/default-poster.png"; const entryLink = displayEntry ? `/entry/${displayEntry.id}` : tmdbEntry - ? `/entry/tmdb/${isTv ? 'tv' : 'movie'}/${tmdbEntry.id}` + ? `/entry/tmdb/${isTv ? "tv" : "movie"}/${tmdbEntry.id}` : undefined; const handleAdd = (e: React.MouseEvent) => { @@ -101,7 +127,7 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem if (!tmdbEntry) return; createEntry.mutate( { tmdb_id: tmdbEntry.id, is_tvserie: isTv }, - { onSuccess: (newEntry) => navigate(`/entry/${newEntry.id}`) } + { onSuccess: (newEntry) => navigate(`/entry/${newEntry.id}`) }, ); }; @@ -115,13 +141,19 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem const toggleFavorite = () => { if (libraryEntry) { - updateEntry.mutate({ id: libraryEntry.id, data: { favorit: !libraryEntry.favorit } }); + updateEntry.mutate({ + id: libraryEntry.id, + data: { favorit: !libraryEntry.favorit }, + }); } }; const toggleHidden = () => { if (libraryEntry) { - updateEntry.mutate({ id: libraryEntry.id, data: { hidden: !libraryEntry.hidden } }); + updateEntry.mutate({ + id: libraryEntry.id, + data: { hidden: !libraryEntry.hidden }, + }); } }; @@ -150,62 +182,116 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem {/* Quick actions button – top right, shown on hover */} {isInLibrary && ( -
- +
+ - e.stopPropagation()}> + e.stopPropagation()} + > {/* Watch & Rate */} - { e.stopPropagation(); setShowSeenDialog(true); }}> + { + e.stopPropagation(); + setShowSeenDialog(true); + }} + > Mark as watched - { e.stopPropagation(); setShowRatingDialog(true); }}> + { + e.stopPropagation(); + setShowRatingDialog(true); + }} + > Rate this {!isTv && ( - { e.stopPropagation(); setShowWatchHistoryDialog(true); }}> + { + e.stopPropagation(); + setShowWatchHistoryDialog(true); + }} + > Watch History )} {/* Organize */} - { e.stopPropagation(); toggleFavorite(); }}> - - {libraryEntry?.favorit ? 'Unfavorite' : 'Favorite'} + { + e.stopPropagation(); + toggleFavorite(); + }} + > + + {libraryEntry?.favorit ? "Unfavorite" : "Favorite"} - { e.stopPropagation(); setShowCollectionDialog(true); }}> + { + e.stopPropagation(); + setShowCollectionDialog(true); + }} + > Add to collection - { e.stopPropagation(); toggleHidden(); }}> + { + e.stopPropagation(); + toggleHidden(); + }} + > - {libraryEntry?.hidden ? 'Unhide' : 'Hide'} + {libraryEntry?.hidden ? "Unhide" : "Hide"} {/* Manage */} { e.stopPropagation(); refreshEntry.mutate(libraryEntry!.id); }} + onClick={(e) => { + e.stopPropagation(); + refreshEntry.mutate(libraryEntry!.id); + }} disabled={refreshEntry.isPending} > - - {refreshEntry.isPending ? 'Refreshing...' : 'Refresh details'} + + {refreshEntry.isPending ? "Refreshing..." : "Refresh details"} - { e.stopPropagation(); setShowMediaDialog(true); }}> + { + e.stopPropagation(); + setShowMediaDialog(true); + }} + > Manage media - { e.stopPropagation(); setShowSettingsDialog(true); }}> + { + e.stopPropagation(); + setShowSettingsDialog(true); + }} + > Settings @@ -214,7 +300,10 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem <> { e.stopPropagation(); setShowRemoveCollectionConfirm(true); }} + onClick={(e) => { + e.stopPropagation(); + setShowRemoveCollectionConfirm(true); + }} className="text-destructive focus:text-destructive" > @@ -225,7 +314,10 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem {/* Danger */} { e.stopPropagation(); setShowConfirm(true); }} + onClick={(e) => { + e.stopPropagation(); + setShowConfirm(true); + }} className="text-destructive focus:text-destructive" > @@ -242,7 +334,7 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem variant="secondary" className="absolute bottom-2 right-2 text-[10px] px-1.5 py-0.5 opacity-90 z-10 pointer-events-none" > - {isTv ? 'TV Series' : 'Movie'} + {isTv ? "TV Series" : "Movie"} )} @@ -256,7 +348,7 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem {rating != null && rating > 0 && ( - {typeof rating === 'number' ? rating.toFixed(1) : rating} + {typeof rating === "number" ? rating.toFixed(1) : rating} )} {year && {year}} @@ -277,7 +369,7 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem ) : ( )} - {createEntry.isPending ? 'Adding...' : 'Add to Library'} + {createEntry.isPending ? "Adding..." : "Add to Library"}
)} @@ -286,19 +378,10 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge, collectionId, onRem
); - - - - - ); return ( <> - {entryLink ? ( - {card} - ) : ( - card - )} + {entryLink ? {card} : card} void; @@ -388,7 +475,11 @@ function LazyEntrySeenDialog({ entry, open, onOpenChange }: { ); } -function LazyMovieWatchHistoryDialog({ entryId, open, onOpenChange }: { +function LazyMovieWatchHistoryDialog({ + entryId, + open, + onOpenChange, +}: { entryId: number; open: boolean; onOpenChange: (open: boolean) => void; diff --git a/react_frontend/src/pages/CollectionDetailsPage.tsx b/react_frontend/src/pages/CollectionDetailsPage.tsx index 62aedb3..96a71c8 100644 --- a/react_frontend/src/pages/CollectionDetailsPage.tsx +++ b/react_frontend/src/pages/CollectionDetailsPage.tsx @@ -1,8 +1,8 @@ -import { useState, useMemo } from 'react'; +import { useState, useMemo, useEffect } from 'react'; import { useParams, useNavigate } from 'react-router-dom'; import { useCollection, useDeleteCollection, useGetCollectionParts, useRemoveEntryFromCollection } from '@/hooks/useCollections'; import { EntryLibraryGrid } from '@/components/entries/EntryLibraryGrid'; -import { getCollectionPosterUrl } from '@/lib/media-utils'; +import { getCollectionPosterUrl, getBackdropUrl } from '@/lib/media-utils'; import { getTmdbImageUrl } from '@/lib/api'; import { Skeleton } from '@/components/ui/skeleton'; import { Button } from '@/components/ui/button'; @@ -12,7 +12,7 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; -import { Star, MoreVertical, Pencil, Download, Trash2, ArrowUpDown, ArrowUp, ArrowDown } from 'lucide-react'; +import { Star, MoreVertical, Pencil, Download, Trash2, ArrowUp, ArrowDown } from 'lucide-react'; import { CollectionEditDialog } from '@/components/dialogs/CollectionEditDialog'; import { ConfirmDialog } from '@/components/dialogs/ConfirmDialog'; import { toast } from 'sonner'; @@ -33,37 +33,13 @@ export function CollectionDetailsPage() { const getCollectionParts = useGetCollectionParts(); const removeEntryFromCollection = useRemoveEntryFromCollection(); - if (isLoading) { - return ( -
- - -
- {Array.from({ length: 6 }).map((_, i) => ( - - ))} -
-
- ); - } - - if (!collection || isError) { - toast.error('Collection not found'); - navigate('/collections', { replace: true }); - return null; - } - - const backdropUrl = collection.backdrop_path - ? getTmdbImageUrl(collection.backdrop_path, 'w1280') - : null; - - const entries = (collection.entries || []).map((e) => ({ - ...e, - isInLibrary: true, - })); + const entries = useMemo( + () => (collection?.entries || []).map((e) => ({ ...e, isInLibrary: true })), + [collection?.entries] + ); const sortedEntries = useMemo(() => { - const sorted = [...entries].sort((a, b) => { + return [...entries].sort((a, b) => { let cmp = 0; switch (sortField) { case 'order': { @@ -90,9 +66,22 @@ export function CollectionDetailsPage() { } return sortDir === 'asc' ? cmp : -cmp; }); - return sorted; }, [entries, sortField, sortDir]); + // Fallback backdrop: use first entry's backdrop if collection has none + const backdropUrl = useMemo(() => { + if (collection?.backdrop_path) return getTmdbImageUrl(collection.backdrop_path, 'w1280'); + // Try to find a backdrop from one of the entries + const entryWithBackdrop = entries.find((e) => e.banner_path); + if (entryWithBackdrop?.banner_path) return getTmdbImageUrl(entryWithBackdrop.banner_path, 'w1280'); + // Try entry medias + for (const e of entries) { + const url = getBackdropUrl(e); + if (url) return url; + } + return null; + }, [collection?.backdrop_path, entries]); + const handleSort = (field: CollectionSortField) => { if (field === sortField) { setSortDir((d) => (d === 'asc' ? 'desc' : 'asc')); @@ -102,6 +91,30 @@ export function CollectionDetailsPage() { } }; + // Handle error redirect in useEffect (not during render) + useEffect(() => { + if (!isLoading && (isError || (!collection && !isLoading))) { + toast.error('Collection not found'); + navigate('/collections', { replace: true }); + } + }, [isLoading, isError, collection, navigate]); + + if (isLoading) { + return ( +
+ + +
+ {Array.from({ length: 6 }).map((_, i) => ( + + ))} +
+
+ ); + } + + if (!collection) return null; + const handleDelete = () => { deleteCollection.mutate(collection.id, { onSuccess: () => navigate('/collections', { replace: true }), @@ -123,7 +136,7 @@ export function CollectionDetailsPage() { className="h-48 w-full object-cover sm:h-64" /> ) : ( -
+
)}
@@ -186,32 +199,31 @@ export function CollectionDetailsPage() {
+ + {/* Sort – bottom right */} + {entries.length > 1 && ( +
+ {(['order', 'year', 'title', 'rating'] as const).map((field) => ( + + ))} +
+ )} - {/* Sort toolbar */} - {entries.length > 1 && ( -
- - {(['order', 'year', 'title', 'rating'] as const).map((field) => ( - - ))} -
- )} - {/* Entries grid */} s.activeTab); @@ -65,6 +66,7 @@ export function LibraryPage() { const filters = useLibraryFiltersStore((s) => s.filters); const setFilters = useLibraryFiltersStore((s) => s.setFilters); const clearFilters = useLibraryFiltersStore((s) => s.clearFilters); + const resetAll = useLibraryFiltersStore((s) => s.resetAll); const [debouncedSearch, setDebouncedSearch] = useState(search); const [debouncedFilters, setDebouncedFilters] = useState(filters); @@ -73,6 +75,15 @@ export function LibraryPage() { const allEntries = useLibraryEntries(); + // Reset filters when navigating TO the library (not when pressing back) + useEffect(() => { + if (navigationType !== 'POP') { + resetAll(); + } + // Only run on mount + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + // Read URL query params once on mount useEffect(() => { if (filtersInitialized.current) return; diff --git a/react_frontend/src/pages/PeoplePage.tsx b/react_frontend/src/pages/PeoplePage.tsx index fe32ab1..9743eba 100644 --- a/react_frontend/src/pages/PeoplePage.tsx +++ b/react_frontend/src/pages/PeoplePage.tsx @@ -5,19 +5,21 @@ import { useSearchLocalPeople } from '@/hooks/usePeople'; import { Input } from '@/components/ui/input'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; import { Skeleton } from '@/components/ui/skeleton'; -import { Button } from '@/components/ui/button'; import { Switch } from '@/components/ui/switch'; import { Label } from '@/components/ui/label'; +import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { Search, Heart } from 'lucide-react'; import { getProfileUrl } from '@/lib/media-utils'; type PeopleFilter = 'all' | 'favorite'; +const LOCAL_PAGE_SIZE = 48; export function PeoplePage() { const [search, setSearch] = useState(''); const [debouncedSearch, setDebouncedSearch] = useState(''); const [filter, setFilter] = useState('all'); const [localOnly, setLocalOnly] = useState(false); + const [localVisibleCount, setLocalVisibleCount] = useState(LOCAL_PAGE_SIZE); // Debounce search input useEffect(() => { @@ -25,6 +27,11 @@ export function PeoplePage() { return () => clearTimeout(timer); }, [search]); + // Reset visible count when filter/search changes + useEffect(() => { + setLocalVisibleCount(LOCAL_PAGE_SIZE); + }, [debouncedSearch, filter, localOnly]); + const isSearching = debouncedSearch.length > 0; const popularQuery = usePopularPeople(); @@ -43,31 +50,40 @@ export function PeoplePage() { ); // Determine displayed people + const filteredLocalPeople = useMemo(() => { + if (!localOnly) return []; + const people = isSearching ? localSearchResults : allLocalPeople; + if (filter === 'favorite') { + return people.filter((p: any) => p.favorite); + } + return people; + }, [localOnly, isSearching, localSearchResults, allLocalPeople, filter]); + const displayPeople = useMemo(() => { if (localOnly) { - const people = isSearching ? localSearchResults : allLocalPeople; - if (filter === 'favorite') { - return people.filter((p: any) => p.favorite); - } - return people; + return filteredLocalPeople.slice(0, localVisibleCount); } - // TMDB mode - filter not applicable for TMDB results return tmdbPeople; - }, [localOnly, isSearching, localSearchResults, allLocalPeople, tmdbPeople, filter]); + }, [localOnly, filteredLocalPeople, localVisibleCount, tmdbPeople]); + + const hasMoreLocal = localOnly && localVisibleCount < filteredLocalPeople.length; const observerRef = useRef(null); const lastRef = useCallback( (node: HTMLDivElement | null) => { - if (!activeQuery || activeQuery.isFetchingNextPage) return; if (observerRef.current) observerRef.current.disconnect(); + if (!node) return; observerRef.current = new IntersectionObserver((entries) => { - if (entries[0].isIntersecting && activeQuery.hasNextPage) { + if (!entries[0].isIntersecting) return; + if (localOnly) { + if (hasMoreLocal) setLocalVisibleCount((c) => c + LOCAL_PAGE_SIZE); + } else if (activeQuery && !activeQuery.isFetchingNextPage && activeQuery.hasNextPage) { activeQuery.fetchNextPage(); } }); - if (node) observerRef.current.observe(node); + observerRef.current.observe(node); }, - [activeQuery?.isFetchingNextPage, activeQuery?.hasNextPage, activeQuery?.fetchNextPage] + [localOnly, hasMoreLocal, activeQuery?.isFetchingNextPage, activeQuery?.hasNextPage, activeQuery?.fetchNextPage] ); useEffect(() => { @@ -94,31 +110,8 @@ export function PeoplePage() { /> - {/* Filter: All / Favorite (only in local mode) */} - {localOnly && ( -
- - -
- )} - {/* Local DB toggle */} -
+
+ + {/* Filter tabs: All / Favorite — always visible, disabled when not local */} +
+ setFilter(v as PeopleFilter)} + > + + + All + + + + Favorite + + + +
{isLoading ? ( @@ -148,7 +159,7 @@ export function PeoplePage() { {displayPeople.map((person: any, index: number) => (
diff --git a/react_frontend/src/pages/TmdbPreviewPage.tsx b/react_frontend/src/pages/TmdbPreviewPage.tsx index 8eb9a04..e879748 100644 --- a/react_frontend/src/pages/TmdbPreviewPage.tsx +++ b/react_frontend/src/pages/TmdbPreviewPage.tsx @@ -4,9 +4,11 @@ import { useLibraryStore } from '@/stores/useLibraryStore'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Separator } from '@/components/ui/separator'; -import { Star, Plus, Loader2, ExternalLink, Tv, Film } from 'lucide-react'; +import { Star, Plus, Loader2, ExternalLink } from 'lucide-react'; import { EntryDetailsSkeleton } from '@/components/skeletons/PageSkeletons'; +import { CastList } from "@/components/entries/CastList"; import { getYear, formatRuntime } from '@/lib/media-utils'; +import type { Credit } from '@/types'; const TMDB_IMG = 'https://image.tmdb.org/t/p'; @@ -127,25 +129,13 @@ export function TmdbPreviewPage() { {/* RIGHT: Info */}
{/* Title */} -
+

{preview.title}

- {preview.tagline && ( -

{preview.tagline}

- )}
{/* Meta */}
- - {preview.is_tvseries ? : } - {preview.is_tvseries ? 'TV Series' : 'Movie'} - - {preview.release_date && ( - <> - • - {getYear(preview.release_date)} - - )} + {preview.release_date && {getYear(preview.release_date)}} {preview.is_tvseries && preview.status && ( <> • @@ -154,7 +144,7 @@ export function TmdbPreviewPage() { )} {preview.runtime && !preview.is_tvseries && ( <> - • + {preview.release_date && •} {formatRuntime(preview.runtime)} )} @@ -207,6 +197,16 @@ export function TmdbPreviewPage() { )}
+ + {/* Sections */} +
+ {preview.credits && preview.credits.length > 0 && ( + <> + + + + )} +
); diff --git a/react_frontend/src/stores/useLibraryFiltersStore.ts b/react_frontend/src/stores/useLibraryFiltersStore.ts index 31bca21..fa993b9 100644 --- a/react_frontend/src/stores/useLibraryFiltersStore.ts +++ b/react_frontend/src/stores/useLibraryFiltersStore.ts @@ -27,6 +27,7 @@ interface LibraryFiltersState { setSortDir: (dir: SortDir) => void; setFilters: (updater: Filters | ((prev: Filters) => Filters)) => void; clearFilters: () => void; + resetAll: () => void; } const defaultFilters: Filters = { @@ -55,6 +56,14 @@ export const useLibraryFiltersStore = create((set) => ({ filters: typeof updater === 'function' ? updater(state.filters) : updater, })), clearFilters: () => set({ filters: defaultFilters }), + resetAll: () => + set({ + activeTab: 'all', + search: '', + sortField: 'date_last_seen', + sortDir: 'desc', + filters: defaultFilters, + }), })); export { defaultFilters }; diff --git a/react_frontend/src/types/index.ts b/react_frontend/src/types/index.ts index 82678b6..9933367 100644 --- a/react_frontend/src/types/index.ts +++ b/react_frontend/src/types/index.ts @@ -245,6 +245,19 @@ export interface TmdbPaginatedResponse { total_results: number; } +export interface TmdbPreviewCredit { + id: string | number; + cast_type: 'cast'; + character: string | null; + people_id: number; + people: { + id: number; + name: string; + profile_path: string | null; + tmdb_id: number; + }; +} + export interface TmdbPreview { tmdb_id: number; title: string; @@ -265,4 +278,5 @@ export interface TmdbPreview { networks: { id: number; name: string; logo_path: string | null }[]; homepage: string | null; imdb_id: string | null; + credits: TmdbPreviewCredit[]; }