443445f0fe
fix(catalog): make media_items scalar columns NOT NULL to stop NULL-scan crashes ( #228 )
...
media_items had many columns the Go model (models.MediaItem) declares as
non-pointer string/int fields, but migration 001 left them nullable. Five
scanners (catalog item_repo, catalog browse, jellycompat, sections, and
the catalog API handler) read these straight into the non-pointer fields,
so a NULL row panics with "cannot scan NULL into *string" (or *int).
item_repo papers over a subset (poster/backdrop/logo/metadata paths) with
COALESCE in its SELECT, but the other four scanners read the same columns
raw and crash; sort_title/original_title/etc. are not coalesced anywhere.
No writer stores a meaningful NULL (every insert/upsert passes the Go
field, '' or 0 at worst) and all sort/filter SQL already collapses NULL
and '' (e.g. COALESCE(NULLIF(BTRIM(sort_title), ''), title); "poster_path
IS NULL OR poster_path = ''"). Enforce the invariant the code already
assumes at the schema level rather than scattering COALESCE across every
current and future scanner. Mirrors what later migrations already did for
original_language, show_status, default_metadata_language, and the
*_source_path columns (all NOT NULL DEFAULT '').
- Migration: backfill existing NULLs, then NOT NULL DEFAULT '' on 15 text
columns (sort_title, original_title, content_rating, overview, tagline,
imdb_id/tmdb_id/tvdb_id, poster_path, poster_thumbhash, backdrop_path,
backdrop_thumbhash, logo_path, metadata_s3_path, metadata_etag) and
NOT NULL DEFAULT 0 on year/runtime.
- item_repo: SetLocalPoster and UpdateArtworkIfSourceMatches now store ''
for empty thumbhashes (was NULLIF($,'')) — the only deliberate NULL
writers — matching the upsert path.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-26 16:06:01 -04:00
..
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 15:57:05 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-06 23:51:30 -04:00
2026-06-09 13:00:48 -04:00
2026-06-08 18:17:08 -04:00
2026-06-07 15:57:05 -04:00
2026-06-07 17:18:55 -04:00
2026-06-07 17:18:55 -04:00
2026-06-09 13:00:48 -04:00
2026-06-07 21:32:40 -04:00
2026-06-10 08:18:35 -04:00
2026-06-10 08:18:35 -04:00
2026-06-10 08:18:35 -04:00
2026-06-09 13:00:48 -04:00
2026-06-08 21:55:35 -04:00
2026-06-08 21:55:35 -04:00
2026-06-08 21:55:35 -04:00
2026-06-16 17:58:01 -04:00
2026-06-16 18:17:08 -04:00
2026-06-09 19:28:53 -04:00
2026-06-09 19:44:40 -04:00
2026-06-10 08:18:35 -04:00
2026-06-10 08:18:35 -04:00
2026-06-10 08:18:35 -04:00
2026-06-10 17:18:18 -04:00
2026-06-10 14:58:54 -04:00
2026-06-10 14:58:54 -04:00
2026-06-10 11:56:59 -04:00
2026-06-16 20:13:10 -04:00
2026-06-10 16:02:42 -04:00
2026-06-16 20:13:10 -04:00
2026-06-11 14:55:46 -04:00
2026-06-11 14:55:46 -04:00
2026-06-11 14:55:46 -04:00
2026-06-11 16:04:22 -04:00
2026-06-11 18:09:37 -04:00
2026-06-11 17:16:27 -04:00
2026-06-11 19:51:03 -04:00
2026-06-11 19:51:03 -04:00
2026-06-11 20:55:30 -04:00
2026-06-11 23:04:35 -04:00
2026-06-12 16:20:55 -04:00
2026-06-12 09:32:53 -04:00
2026-06-15 15:34:13 -04:00
2026-06-15 15:34:13 -04:00
2026-06-17 13:12:18 -04:00
2026-06-17 09:51:43 -04:00
2026-06-17 09:51:43 -04:00
2026-06-16 20:13:10 -04:00
2026-06-17 13:48:57 -04:00
2026-06-18 10:07:58 -04:00
2026-06-18 10:07:58 -04:00
2026-06-19 06:13:26 +02:00
2026-06-23 14:26:14 -04:00
2026-06-24 11:03:38 -04:00
2026-06-24 11:03:38 -04:00
2026-06-25 13:29:30 -04:00
2026-06-25 16:20:14 -04:00
2026-06-25 20:46:08 -04:00
2026-06-25 20:46:08 -04:00
2026-06-25 20:50:45 -04:00
2026-06-25 22:43:23 -04:00
2026-06-26 12:09:45 -04:00
2026-06-26 16:05:53 -04:00
2026-06-26 16:05:53 -04:00
2026-06-26 16:06:01 -04:00