docs: api comments say what the endpoints do, not how they came to be (#6277)
Rewrites the internal/api comment blocks to rule 32: task, milestone and rule ids gone, the stories behind them restated as the constraint they left, stale references corrected (the stream secret is wired from config, the timezone handler already refreshes the scheduler, the Android app is the native client, the design docs cited are not in the repo). Also rewraps comment lines over 80 columns left by the earlier batches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,8 +3,8 @@ package api
|
||||
// Wire shapes for /api/library/sync upserts. The sqlc-generated row
|
||||
// structs (dbq.Artist, dbq.Album, dbq.Track, dbq.Playlist) have no
|
||||
// JSON tags (sqlc.yaml: emit_json_tags=false), so a raw json.Marshal
|
||||
// of them produces PascalCase field names that the Flutter sync
|
||||
// controller (which reads snake_case keys) can't parse.
|
||||
// of them produces PascalCase field names, and clients read snake_case
|
||||
// keys.
|
||||
//
|
||||
// These view structs add the JSON tag layer + flatten pgtype.UUID and
|
||||
// pgtype.Timestamptz / Date into strings, mirroring the pattern
|
||||
@@ -50,7 +50,7 @@ type albumSyncView struct {
|
||||
ReleaseDate *string `json:"release_date"`
|
||||
CoverArtPath *string `json:"cover_art_path"`
|
||||
Mbid *string `json:"mbid"`
|
||||
// AlbumGain and AlbumPeak are the album's ReplayGain 2.0 values (#4997):
|
||||
// AlbumGain and AlbumPeak are the album's ReplayGain 2.0 values:
|
||||
// dB to the -18 LUFS reference, and a linear peak. Null until every track
|
||||
// on the album is measured.
|
||||
AlbumGain *float32 `json:"album_gain"`
|
||||
@@ -87,20 +87,20 @@ type trackSyncView struct {
|
||||
FilePath string `json:"file_path"`
|
||||
FileFormat string `json:"file_format"`
|
||||
Genre *string `json:"genre"`
|
||||
// Missing reports that the file is currently absent from disk (#2704).
|
||||
// Missing reports that the file is currently absent from disk.
|
||||
//
|
||||
// Shipped as state rather than filtered out of the feed, because a
|
||||
// missing file is expected to come back: the scanner clears the mark
|
||||
// when it does, and adopts the row if it returns under a new name
|
||||
// (#2528). Dropping the row instead would mean a delete-and-recreate on
|
||||
// every client for what is often a transient unmount, churning caches
|
||||
// and discarding the identity #2528 works to preserve.
|
||||
// when it does, and adopts the row if it returns under a new name.
|
||||
// Dropping the row instead would mean a delete-and-recreate on every
|
||||
// client for what is often a transient unmount, churning caches and
|
||||
// discarding the track's identity.
|
||||
//
|
||||
// A bool rather than the timestamp: clients need it to decide whether a
|
||||
// track is playable, which is a yes/no. The "gone since" clock is an
|
||||
// operator concern and lives on the admin surface.
|
||||
// admin concern and lives on the admin surface.
|
||||
Missing bool `json:"missing"`
|
||||
// TrackGain and TrackPeak are the track's ReplayGain 2.0 values (#4997).
|
||||
// TrackGain and TrackPeak are the track's ReplayGain 2.0 values.
|
||||
// Null until the track is measured. The album's pair rides on the album
|
||||
// view, since it changes when the album does, not when this track does.
|
||||
TrackGain *float32 `json:"track_gain"`
|
||||
|
||||
Reference in New Issue
Block a user