feat(frontend): show seen dates inline on episode cards and fix cast page
- Display all seen dates inline (comma-separated) on episode cards in SeasonPage; remove unused Tooltip imports - Propagate episode_count in normalizeCredit so TV series cast shows X ep. - Add entriesApi.getCredits(id) API method and useEntryCredits(id) hook - Load all credits in EntryCastsPage via useEntryCredits (no more 10-cast limit) - Replace full-list render with IntersectionObserver lazy loader (24 per chunk) - Fix Sort/Filter Select trigger to show human-readable label instead of raw key
This commit is contained in:
1 parent
22d111ef71
commit
5fa2556b43
4 files changed
+92
-17
No files matched your search
@@ -8,6 +8,7 @@ export const entryKeys = {
|
||||
all: ['entries'] as const,
|
||||
detail: (id: number) => ['entries', id] as const,
|
||||
seasons: (id: number) => ['entries', id, 'seasons'] as const,
|
||||
credits: (id: number) => ['entries', id, 'credits'] as const,
|
||||
tmdbPreview: (tmdbId: number, type: string) => ['entries', 'tmdb-preview', type, tmdbId] as const,
|
||||
};
|
||||
|
||||
@@ -41,6 +42,15 @@ export function useEntrySeasons(id: number) {
|
||||
});
|
||||
}
|
||||
|
||||
export function useEntryCredits(id: number) {
|
||||
return useQuery({
|
||||
queryKey: entryKeys.credits(id),
|
||||
queryFn: () => entriesApi.getCredits(id),
|
||||
enabled: !!id,
|
||||
staleTime: 5 * 60 * 1000,
|
||||
});
|
||||
}
|
||||
|
||||
export function useCreateEntry() {
|
||||
const queryClient = useQueryClient();
|
||||
const addEntry = useLibraryStore((s) => s.addEntry);
|
||||
|
||||
Reference in new issue
Block a user