A mirrored Shows library whose items have no genres stored `genres` as JSON `null` — SQLAlchemy's JSONB persists a Python None as a JSON scalar, not SQL NULL. /facets unnested it with jsonb_array_elements_text(), which raises "cannot extract elements from a scalar", so a single bare library 500'd the whole Plex module on open (the grid loads, the filter sidebar's facets call dies). - Guard the /facets genre unnest with jsonb_typeof(genres)='array', mirroring the guard people.py already applies to the same columns. - Persist the JSONB tag columns (genres/directors/cast_names/collection_keys on plex_items and plex_shows) with none_as_null=True, so an empty list round-trips as SQL NULL and self-heals on the next sync — closing the trap for any future unnest. Verified against the real prod row (DumaTV show, genres = JSON null): the unguarded query errors, the guarded one returns cleanly.
1 line
6 B
Plaintext
1 line
6 B
Plaintext
0.53.1 |