style: apply gofmt across Go sources

Repo-wide gofmt sweep: const-block alignment, doc-comment spacing,
statement-after-brace fix in media.go, trailing blank lines. No
semantic changes — whitespace-insensitive diff is empty for every
file in this commit.
This commit is contained in:
John O'Keefe committed 2026-10-25 11:05:37 -04:00
1 parent dd2ab4ea96
commit 8733e83f1f
29 files changed
+91 -1725

No files matched your search

+3 -3
View File
@@ -19,9 +19,9 @@ type BookMatch struct {
Confidence float64 `json:"confidence"`
MatchMethod string `json:"match_method"`
// Display fields, filled during the family-lens pass in QueryBooks.
Title string `json:"title"`
Author string `json:"author"`
CoverImagePath string `json:"cover_image_path"`
Title string `json:"title"`
Author string `json:"author"`
CoverImagePath string `json:"cover_image_path"`
}
// BookQueryRequest represents a book query from a device
+15 -15
View File
@@ -61,10 +61,10 @@ const (
KindBool FilterKind = "bool"
KindNumber FilterKind = "number"
KindDate FilterKind = "date"
KindPresence FilterKind = "presence" // has / missing
KindPresence FilterKind = "presence" // has / missing
KindIdentifier FilterKind = "identifier" // exact is/is_not + has/missing
KindNoteText FilterKind = "note_text" // joined-table ILIKE substring (viewer's rows)
KindStatus FilterKind = "status" // unread / reading / finished
KindNoteText FilterKind = "note_text" // joined-table ILIKE substring (viewer's rows)
KindStatus FilterKind = "status" // unread / reading / finished
KindLibrary FilterKind = "library"
KindCollection FilterKind = "collection"
)
@@ -81,13 +81,13 @@ const (
suggestContrib SuggestSource = "contributor"
suggestPublisher SuggestSource = "publisher"
suggestTags SuggestSource = "tags"
suggestColumn SuggestSource = "column" // the field's own scalar column
suggestSeries SuggestSource = "series" // primary + alternate_info
suggestNoteText SuggestSource = "note_text" // the viewer's note snippets
suggestColumn SuggestSource = "column" // the field's own scalar column
suggestSeries SuggestSource = "series" // primary + alternate_info
suggestNoteText SuggestSource = "note_text" // the viewer's note snippets
suggestHighlight SuggestSource = "highlight_text"
suggestLibrary SuggestSource = "library" // visibility-scoped libraries
suggestCollection SuggestSource = "collection" // the viewer's collections
suggestAddedBy SuggestSource = "added_by" // admins who added books in scope
suggestLibrary SuggestSource = "library" // visibility-scoped libraries
suggestCollection SuggestSource = "collection" // the viewer's collections
suggestAddedBy SuggestSource = "added_by" // admins who added books in scope
)
// Filter menu groups (display order for the field menu).
@@ -127,12 +127,12 @@ type FilterChild struct {
// FilterField is one registry entry.
type FilterField struct {
Key string // wire name (the qf "field" value)
Label string // menu label
Group string // menu group
Key string // wire name (the qf "field" value)
Label string // menu label
Group string // menu group
Kind FilterKind
Ops []string // allowed operators, display order
DefaultOp string // operator a new rule starts on (field-switch reset)
Ops []string // allowed operators, display order
DefaultOp string // operator a new rule starts on (field-switch reset)
Clause func(r FilterRule, b *filterBuilder) string
Suggest SuggestSource
}
@@ -146,7 +146,7 @@ var opsNoValue = map[string]bool{
// fixedDomains are the operator value domains that are STATIC (validated
// here) rather than data-driven suggestions.
var fixedDomains = map[string][]string{
"status": {"unread", "reading", "finished"},
"status": {"unread", "reading", "finished"},
"file_availability": {"available", "missing"},
}
@@ -538,34 +538,34 @@ func (s *MediaScanner) createAudioBookItem(ctx context.Context, libraryID pgtype
// single-file path — folder-of-tracks books carry the same naming.
applyTitleDerivedSeries(metadata)
created, err := s.db.CreateMediaItem(ctx, database.CreateMediaItemParams{
LibraryID: libraryID,
Title: metadata.Title,
Subtitle: pgtype.Text{String: metadata.Subtitle, Valid: metadata.Subtitle != ""},
Authors: nilToEmpty(utils.SingleOrSlice(metadata.Author, metadata.Authors)),
AuthorsSearch: utils.NormalizeTagsSearch(utils.SingleOrSlice(metadata.Author, metadata.Authors)),
Isbn: pgtype.Text{String: utils.NormalizeISBNSafe(metadata.ISBN), Valid: metadata.ISBN != ""},
Asin: pgtype.Text{String: metadata.ASIN, Valid: metadata.ASIN != ""},
Description: pgtype.Text{String: metadata.Description, Valid: metadata.Description != ""},
FilePath: relPath,
FileSize: pgtype.Int8{Int64: totalSize, Valid: true},
MimeType: pgtype.Text{String: mimeType, Valid: mimeType != ""},
CoverImagePath: pgtype.Text{String: metadata.CoverPath, Valid: metadata.CoverPath != ""},
Series: pgtype.Text{String: metadata.Series, Valid: metadata.Series != ""},
SeriesNumber: pgtype.Float8{Float64: metadata.SeriesNumber, Valid: metadata.SeriesNumber > 0},
Publishers: nilToEmpty(utils.SingleOrSlice(metadata.Publisher, metadata.Publishers)),
LibraryID: libraryID,
Title: metadata.Title,
Subtitle: pgtype.Text{String: metadata.Subtitle, Valid: metadata.Subtitle != ""},
Authors: nilToEmpty(utils.SingleOrSlice(metadata.Author, metadata.Authors)),
AuthorsSearch: utils.NormalizeTagsSearch(utils.SingleOrSlice(metadata.Author, metadata.Authors)),
Isbn: pgtype.Text{String: utils.NormalizeISBNSafe(metadata.ISBN), Valid: metadata.ISBN != ""},
Asin: pgtype.Text{String: metadata.ASIN, Valid: metadata.ASIN != ""},
Description: pgtype.Text{String: metadata.Description, Valid: metadata.Description != ""},
FilePath: relPath,
FileSize: pgtype.Int8{Int64: totalSize, Valid: true},
MimeType: pgtype.Text{String: mimeType, Valid: mimeType != ""},
CoverImagePath: pgtype.Text{String: metadata.CoverPath, Valid: metadata.CoverPath != ""},
Series: pgtype.Text{String: metadata.Series, Valid: metadata.Series != ""},
SeriesNumber: pgtype.Float8{Float64: metadata.SeriesNumber, Valid: metadata.SeriesNumber > 0},
Publishers: nilToEmpty(utils.SingleOrSlice(metadata.Publisher, metadata.Publishers)),
PublishersSearch: utils.NormalizeTagsSearch(utils.SingleOrSlice(metadata.Publisher, metadata.Publishers)),
DatePublished: pgtype.Date{Time: metadata.PublishDate, Valid: !metadata.PublishDate.IsZero()},
Genre: pgtype.Text{String: metadata.Genre, Valid: metadata.Genre != ""},
Contributors: utils.NormalizeContributors(metadata.Contributors),
Narrators: nilToEmpty(metadata.Narrators),
NarratorsSearch: utils.NormalizeNarratorsSearch(metadata.Narrators),
Abridged: metadata.Abridged,
Explicit: metadata.Explicit,
Tags: utils.NormalizeTags(metadata.Tags),
AddedByAdminID: s.adminID,
CreatedAt: modTime,
ImportedAt: pgtype.Timestamptz{Time: time.Now(), Valid: true},
AudioMetadata: marshalAudioMetadata(metadata.AudioMeta),
DatePublished: pgtype.Date{Time: metadata.PublishDate, Valid: !metadata.PublishDate.IsZero()},
Genre: pgtype.Text{String: metadata.Genre, Valid: metadata.Genre != ""},
Contributors: utils.NormalizeContributors(metadata.Contributors),
Narrators: nilToEmpty(metadata.Narrators),
NarratorsSearch: utils.NormalizeNarratorsSearch(metadata.Narrators),
Abridged: metadata.Abridged,
Explicit: metadata.Explicit,
Tags: utils.NormalizeTags(metadata.Tags),
AddedByAdminID: s.adminID,
CreatedAt: modTime,
ImportedAt: pgtype.Timestamptz{Time: time.Now(), Valid: true},
AudioMetadata: marshalAudioMetadata(metadata.AudioMeta),
})
if err != nil {
// Ledger (Phase 11): row-less import failure keyed by
+4 -4
View File
@@ -18,10 +18,10 @@ func TestManifestEvNormalization(t *testing.T) {
raw string
want int
}{
{`{"v":1}`, 1}, // old shape: ev absent → v1-or-unknown
{`{"v":1,"ev":0}`, 1}, // explicitly unset → same
{`{"v":1,"ev":1}`, 1}, // baseline parser stamp
{`{"v":1,"ev":2}`, 2}, // post-bump stamp
{`{"v":1}`, 1}, // old shape: ev absent → v1-or-unknown
{`{"v":1,"ev":0}`, 1}, // explicitly unset → same
{`{"v":1,"ev":1}`, 1}, // baseline parser stamp
{`{"v":1,"ev":2}`, 2}, // post-bump stamp
{`{"v":1,"entries":[],"ev":3}`, 3}, // sidecar-less ev home
}
for _, tc := range cases {
+4 -4
View File
@@ -17,10 +17,10 @@ import (
// SeriesCandidate is one parsed series membership from any source.
type SeriesCandidate struct {
Name string
Sequence string // raw sequence text ("3", "1.5", "1a", "Book 2")
Number float64 // leading number of Sequence (0 = none parsed)
HasNum bool
Name string
Sequence string // raw sequence text ("3", "1.5", "1a", "Book 2")
Number float64 // leading number of Sequence (0 = none parsed)
HasNum bool
FromSidecar bool
}