feat(db): SearchMediaItemsUnifiedRow carries abridged + audio_metadata

The unified search row lagged the table (survey overstated it —
narrators was already there). Both columns come from the
already-scanned media_items side of the joins: EXPLAIN before/after is
plan-identical (same Nested Loop shape, no new scans). Row-completeness
only — no client surface changes; the hand maps select their own keys.
This commit is contained in:
John O'Keefe committed 2026-10-17 16:55:04 -04:00
1 parent 87fc89a816
commit c538efe722
2 files changed
+8

No files matched your search

+6
View File
@@ -12567,6 +12567,8 @@ SELECT
mi.tags_search, mi.tags_search,
mi.contributors_search, mi.contributors_search,
mi.narrators, mi.narrators,
mi.abridged,
mi.audio_metadata,
mi.file_sha256, mi.file_sha256,
mi.opf_identifier, mi.opf_identifier,
mi.opf_uuid, mi.opf_uuid,
@@ -12781,6 +12783,8 @@ type SearchMediaItemsUnifiedRow struct {
TagsSearch []string `db:"tags_search" json:"tags_search"` TagsSearch []string `db:"tags_search" json:"tags_search"`
ContributorsSearch []string `db:"contributors_search" json:"contributors_search"` ContributorsSearch []string `db:"contributors_search" json:"contributors_search"`
Narrators []string `db:"narrators" json:"narrators"` Narrators []string `db:"narrators" json:"narrators"`
Abridged bool `db:"abridged" json:"abridged"`
AudioMetadata []byte `db:"audio_metadata" json:"audio_metadata"`
FileSha256 pgtype.Text `db:"file_sha256" json:"file_sha256"` FileSha256 pgtype.Text `db:"file_sha256" json:"file_sha256"`
OpfIdentifier pgtype.Text `db:"opf_identifier" json:"opf_identifier"` OpfIdentifier pgtype.Text `db:"opf_identifier" json:"opf_identifier"`
OpfUuid pgtype.Text `db:"opf_uuid" json:"opf_uuid"` OpfUuid pgtype.Text `db:"opf_uuid" json:"opf_uuid"`
@@ -12858,6 +12862,8 @@ func (q *Queries) SearchMediaItemsUnified(ctx context.Context, arg SearchMediaIt
&i.TagsSearch, &i.TagsSearch,
&i.ContributorsSearch, &i.ContributorsSearch,
&i.Narrators, &i.Narrators,
&i.Abridged,
&i.AudioMetadata,
&i.FileSha256, &i.FileSha256,
&i.OpfIdentifier, &i.OpfIdentifier,
&i.OpfUuid, &i.OpfUuid,
+2
View File
@@ -658,6 +658,8 @@ SELECT
mi.tags_search, mi.tags_search,
mi.contributors_search, mi.contributors_search,
mi.narrators, mi.narrators,
mi.abridged,
mi.audio_metadata,
mi.file_sha256, mi.file_sha256,
mi.opf_identifier, mi.opf_identifier,
mi.opf_uuid, mi.opf_uuid,