feat(schema): subtitle/explicit columns, authors+publishers arrays, float series numbers
Phase 1 of the series/collections/metadata overhaul
(~/.opencode/plan/series-collections-metadata-overhaul.md).
Schema (in place, idempotent):
- media_items.series_number INTEGER -> DOUBLE PRECISION: real-world
ordinals are decimals (0.5, 1.5 novellas); INTEGER silently truncated
them (calibre 2.5 pinned as 2 in tests).
- + subtitle TEXT, explicit BOOLEAN (sidecar ingest; ABS explicit /
Audible isAdult).
- + authors/authors_search/publishers/publishers_search TEXT[] NOT NULL
(narrators A2a precedent). Arrays are write truth; author/publisher
varchars become trigger-regenerated display strings
(sync_author_publisher_display) so every varchar consumer (trgm
search, facets, API, OPDS/Kobo) keeps working unchanged.
- Row-level NULL normalization for the new arrays in
set_library_type_name (A2 lesson: Go nil -> explicit NULL -> 23502).
- Backfills ARRAY[author]/ARRAY[publisher] — deliberately no
comma-splitting ('Tolkien, J.R.R.' would corrupt; scanner kept only
authors[0] historically).
- collection_items.position INTEGER + (collection_id, position) index
for playlist ordering.
Go: sqlc regen; MediaMetadata/handler params gain Subtitle/Explicit/
Authors/Publishers (legacy singles still accepted, arrays win);
SeriesNumber int32 -> float64 end to end; metadata_overrides adapted
with legacy override keys ('author'/'publisher') preserved so existing
user overrides survive; bulk author edit writes the array.
Pins widened (docs/contract_pins.md): raw sqlc row key set + the six
new columns; changelog entry added.
Verified: unit suite green; integration sweep (bulk/smart collections/
scanner/stats/sync/queue/calibre/pins/audiobooks) green against the
shared dev DB after in-place migration. Pre-existing unrelated red:
TestOwnershipAndAdminTestSuite/TestAdminCreateUser timezone inheritance
fails identically at the pre-change commit (live shared state).
This commit is contained in:
1 parent
f7dc8189a1
commit
646477afad
30 files changed
+790
-247
No files matched your search
@@ -119,3 +119,20 @@ cover_image_path, has_conflict, format_group, badge`.
|
||||
- `media_items.audio_metadata` payload gained additive JSON keys
|
||||
`layout` and `tracks` (see schema.sql comment). Consumers parse
|
||||
additively; stored single-file payloads are unchanged.
|
||||
|
||||
## 2026-10-19 — A2b: metadata array/model overhaul (phase 1)
|
||||
|
||||
- `media_items.series_number` widened INTEGER → DOUBLE PRECISION across all
|
||||
surfaces. JSON serializers emit the same key; values are JSON numbers, so
|
||||
integer-valued ordinals are byte-identical ("3") and decimal ordinals
|
||||
(0.5/1.5) now serialize as decimals instead of truncating. Clients reading
|
||||
JSON numbers are unaffected; the Android client parses either form.
|
||||
- `GET /api/media-items*` / detail responses gain ADDITIVE keys:
|
||||
`subtitle` (string), `explicit` (bool), `authors` ([]string, write truth —
|
||||
legacy `author` display string still emitted, now trigger-regenerated),
|
||||
`publishers` ([]string; legacy `publisher` likewise).
|
||||
- `POST/PUT /api/media-items*` accept ADDITIVE request keys `subtitle`,
|
||||
`explicit`, `authors`, `publishers`; legacy `author`/`publisher` singles
|
||||
still accepted (arrays win when both present).
|
||||
- Override keys unchanged: `author`/`publisher` override names are preserved
|
||||
for existing rows and now protect the arrays.
|
||||
Reference in new issue
Block a user