feat(frontend): navigate non-library entries to TMDB preview page

- Add TmdbPreviewPage showing TMDB details without adding to library
- Display backdrop, poster, title, tagline, genres, rating, storyline
- Show season/episode count for TV series
- Add "Add to Library" button that creates entry then redirects to details page
- Show "Already in Library — View" if entry exists in DB
- Add /entry/tmdb/:type/:tmdbId route in router.tsx
- Add TmdbPreview type, entriesApi.previewTmdb(), and useTmdbPreview() hook
- Update EntryCard to navigate to preview page instead of auto-adding

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Mohammed AbadandCopilot committed 2026-04-27 04:03:21 +01:00
1 parent 25b645a16f
commit 02cdcf733d
18 files changed
+949 -204

No files matched your search

+10
View File
@@ -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,
tmdbPreview: (tmdbId: number, type: string) => ['entries', 'tmdb-preview', type, tmdbId] as const,
};
export function useLibrary() {
@@ -153,3 +154,12 @@ export function useUploadMedia() {
},
});
}
export function useTmdbPreview(tmdbId: number, type: 'movie' | 'tv') {
return useQuery({
queryKey: entryKeys.tmdbPreview(tmdbId, type),
queryFn: () => entriesApi.previewTmdb(tmdbId, type),
enabled: !!tmdbId,
staleTime: 10 * 60 * 1000,
});
}