feat(people): unify person detail page for DB and TMDB sources
- Merge PersonDetailsPage and PersonTmdbRedirectPage into one component - /people/:id fetches from local DB with favorite toggle - /people/tmdb/:tmdbId fetches from TMDB with "Add to Library" button - Add TMDB external link in person metadata - Fix CastList links for TMDB preview cast (use /people/tmdb/:tmdbId) - Replace 11MB getAll() with server-side paginated infinite scroll - Add useLocalPeopleInfinite hook and PaginatedPeopleResponse type
This commit is contained in:
1 parent
6d676d803c
commit
db6da6782f
6 files changed
+231
-59
No files matched your search
@@ -35,9 +35,21 @@ export interface TmdbPersonPreview {
|
||||
filmography: TmdbFilmographyResponse;
|
||||
}
|
||||
|
||||
export interface PaginatedPeopleResponse {
|
||||
data: People[];
|
||||
total: number;
|
||||
page: number;
|
||||
totalPages: number;
|
||||
}
|
||||
|
||||
export const peopleApi = {
|
||||
getAll: () => api.get<People[]>('/people').then((r) => r.data),
|
||||
|
||||
getAllPaginated: (page: number, limit: number, search?: string) =>
|
||||
api
|
||||
.get<PaginatedPeopleResponse>('/people', { params: { page, limit, ...(search ? { search } : {}) } })
|
||||
.then((r) => r.data),
|
||||
|
||||
getById: (id: number) =>
|
||||
api.get<People>(`/people/${id}`).then((r) => r.data),
|
||||
|
||||
|
||||
Reference in new issue
Block a user