refactor: consolidate watchlist states (#18)

- Rename `watchlist` → `in_watchlist` and `in_progress` → `watching` across the full stack (DB migration, Drizzle schema, core services, API contract, web, native)
- Add a new `caught_up` status for TV shows where all aired episodes are watched but the show is still airing
- Add `titles.watchAll` procedure and `markAllWatched` action to mark every episode of a TV show as watched in one step; replace the old "Mark as Watching" / "Mark as Completed" context-menu actions with "Mark All Watched" (TV) and "Mark as Watched" (movie)
- Extract `display-status.ts` in `@sofa/api` to share status → display label/color logic between web and native
- Add `getDisplayStatusesByTitleIds` to `@sofa/core/tracking` and wire it into the dashboard library feed so clients receive resolved display statuses
- Show a destructive Alert confirmation before removing a title from the library (native)
- Remove "Mark as Completed" from the continue-watching card context menu
- Update i18n catalogs for all 6 locales (de, en, es, fr, it, pt)
This commit is contained in:
2026-03-20 15:31:31 -04:00
committed by GitHub
parent 4b4d35ce31
commit 5c70d29fac
49 changed files with 4889 additions and 1309 deletions
@@ -0,0 +1,12 @@
-- TV shows should never have 'completed' stored — convert to 'in_progress'.
-- Display status (caught_up / completed) is now derived at read time from
-- episode progress + TMDB show status.
UPDATE userTitleStatus SET status = 'in_progress'
WHERE status = 'completed'
AND titleId IN (SELECT id FROM titles WHERE type = 'tv');
--> statement-breakpoint
-- Legacy movie rows stored as 'in_progress' (old UI always sent in_progress
-- when clicking Watchlist). Convert to 'watchlist' since no watch was logged.
UPDATE userTitleStatus SET status = 'watchlist'
WHERE status = 'in_progress'
AND titleId IN (SELECT id FROM titles WHERE type = 'movie');
File diff suppressed because it is too large Load Diff