mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 05:05:38 -04:00
feat(core): add pagination to explore, search, person, and library endpoints
Convert trending, search, people.detail, and dashboard.library to page-based responses (`page` / `totalPages`) so clients can load results incrementally. Update `@sofa/core` discovery and person services to accept a `page` / `limit` input and slice results accordingly. Add a new DB migration to persist the data needed to back paginated filmography queries. On the web, introduce a `useInfiniteScroll` hook and wire up `useInfiniteQuery` in the explore, person detail, and filterable title row components with an intersection-observer sentinel. On native, switch the same screens from `useQuery` to `useInfiniteQuery` with `onEndReached` / `ListFooterComponent` loading indicators. Also replace remaining `FlatList` usages with `FlashList` in the home and title detail screens.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
CREATE TABLE `personFilmography` (
|
||||
`id` text PRIMARY KEY,
|
||||
`personId` text NOT NULL,
|
||||
`titleId` text NOT NULL,
|
||||
`character` text,
|
||||
`department` text DEFAULT 'Acting' NOT NULL,
|
||||
`job` text,
|
||||
`displayOrder` integer DEFAULT 0 NOT NULL,
|
||||
CONSTRAINT `fk_personFilmography_personId_persons_id_fk` FOREIGN KEY (`personId`) REFERENCES `persons`(`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_personFilmography_titleId_titles_id_fk` FOREIGN KEY (`titleId`) REFERENCES `titles`(`id`) ON DELETE CASCADE
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE `persons` ADD `filmographyLastFetchedAt` integer;--> statement-breakpoint
|
||||
CREATE INDEX `personFilmography_personId_displayOrder` ON `personFilmography` (`personId`,`displayOrder`);--> statement-breakpoint
|
||||
CREATE INDEX `personFilmography_titleId` ON `personFilmography` (`titleId`);
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user