mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 06:15:39 -04:00
Add genre and content rating storage and display on title pages
Store TMDB genres in normalized tables (genres + titleGenres) and content ratings as a column on titles. Both are fetched during import/refresh using append_to_response for content ratings (no extra API calls). Displayed in the title hero between type badge and year. Also fixes pre-existing type error for profile_path on TmdbSearchResult. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE `genres` (
|
||||
`id` integer PRIMARY KEY,
|
||||
`name` text NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `titleGenres` (
|
||||
`titleId` text NOT NULL,
|
||||
`genreId` integer NOT NULL,
|
||||
CONSTRAINT `fk_titleGenres_titleId_titles_id_fk` FOREIGN KEY (`titleId`) REFERENCES `titles`(`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_titleGenres_genreId_genres_id_fk` FOREIGN KEY (`genreId`) REFERENCES `genres`(`id`) ON DELETE CASCADE
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `titleGenres_titleId_genreId` ON `titleGenres` (`titleId`,`genreId`);--> statement-breakpoint
|
||||
CREATE INDEX `titleGenres_genreId` ON `titleGenres` (`genreId`);--> statement-breakpoint
|
||||
CREATE INDEX `userEpisodeWatches_userId_episodeId` ON `userEpisodeWatches` (`userId`,`episodeId`);--> statement-breakpoint
|
||||
CREATE INDEX `userMovieWatches_userId_titleId` ON `userMovieWatches` (`userId`,`titleId`);
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user