Commit Graph
780 Commits
Author SHA1 Message Date
bvandeusenandClaude Opus 5.5 02cecc4eb7 docs(api): the session cookie comment says sessions expire server-side, because they do (#8108)
release / web (push) Successful in 1m26s
release / go (push) Successful in 1m56s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m29s
release / android (push) Successful in 4m29s
release / Build signed APK (push) Successful in 5m10s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 15s
release / Verify release artifacts (tag releases only) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:30:38 -05:00
bvandeusenandClaude Opus 5.5 40c53c8b98 test(playlists): name a mix by its seed artist too in the rebuild-keeps-ids test (#8081)
release / govulncheck (push) Successful in 20s
release / go (push) Successful in 1m48s
release / web (push) Successful in 1m17s
release / integration (push) Successful in 4m17s
release / android (push) Successful in 4m24s
release / Build signed APK (push) Successful in 4m52s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 24s
release / Verify release artifacts (tag releases only) (push) Skipped
The fixtures make one artist row per track, all named alike, so two Songs
like mixes with different seed artists share a display name, and the test
read them as one mix held twice. It now names a mix by name and seed
artist, as snapshotSystemTracks does (lesson: a snapshot keyed by display
name merges same-named rows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:14:41 -05:00
bvandeusenandClaude Opus 5.5 5939248bef fix(metrics): web and Android tag plays with one source vocabulary, so a surface reads the same on either (#8075)
The recommendation metrics judge each surface against a baseline of manual
plays. The web tagged only system mixes, so its radio, album, artist and
history plays all sat in the baseline; Android tagged nearly everything, and
its search, Liked-list, library-shuffle and artist-top plays fell to Other.
The surface deltas depended on which client someone listened on.

- The web sends the vocabulary Android uses: radio:<seed>, album:<id>,
  artist:<id>, artist-top:<id>, home:most_played and history, kept in
  web/src/lib/player/playSource.ts.
- The baseline is now named in one place (isManualSource): no source, a
  search pick, or a Liked-list pick.
- library_shuffle gets its own row, the random baseline the mixes exist to
  beat; artist-top counts as an artist play.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:08:37 -05:00
bvandeusenandClaude Opus 5.5 2898e9d746 fix(playevents): a late offline replay no longer closes the play that is live now (#8074)
RecordOfflinePlay auto-closed whatever play was open at the replayed play's
original, often hours-old, time. When Android drained its offline queue
while the next song was already playing, each replay ended the live row
before it began, as a zero-length skip. That stuck when the live play's own
close was lost, and for a Subsonic app's now-playing row it became a skip
plus a second play.

autoClosePriorOpen now leaves open any row that started after the time it
was asked to close at, for every caller; #8019's guard for the Subsonic
path moves into it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:04:06 -05:00
bvandeusenandClaude Opus 5.5 b6749fcf16 fix(sync): an artist picture found after the artist first synced reaches the Android app (#8080)
The library sync sends each artist's picture paths, and an app learns that a
row changed only from the change log. The artist enricher wrote the paths
without logging, so an artist synced before its picture arrived kept showing
the album-cover fallback on Android until something else touched it. A
picture found is now logged in the same transaction as the write; settling
"none" changes nothing an app shows and isn't logged.

The MBID backfill's heals of albums.mbid and artists.mbid, also part of the
sync payload, are now logged too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:03:21 -05:00
bvandeusenandClaude Opus 5.5 8ba1d109c3 fix(events): a like made in a Subsonic app reaches the other apps, and an open web tab follows likes and playlist changes (#8077)
The native like endpoints announce a like on the event bus; Subsonic star
and unstar announced nothing, so the web and Android apps showed a stale
heart until they refetched. Subsonic now publishes the same events, through
one shape both surfaces build (eventbus.LikeChanged, eventbus.LedBy).

The web listened only for the nightly rebuild and notifications, so an open
tab ignored likes and playlist changes made in another tab, on Android or
in a Subsonic app. It now refreshes its liked views on any like event and
its playlists (and the open one) on playlist.created/updated/deleted/
tracks_changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:02:12 -05:00
bvandeusenandClaude Opus 5.5 528ea9df0c fix(likes): unliking any copy of a song retires the listening context captured on another (#8078)
release / go (push) Successful in 1m49s
release / web (push) Successful in 1m16s
release / govulncheck (push) Successful in 25s
release / integration (push) Failing after 4m12s
release / android (push) Successful in 4m47s
release / Build signed APK (push) Successful in 5m24s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped
A like is on the song: LikeTrack and UnlikeTrack change every copy sharing
its song_key. The contextual like (the session captured while it played) is
written on the copy that was playing, but an unlike soft-deleted only the
copy it named. Unliking from the Liked list, which shows one copy per song,
or from another album holding the song, left the context active, and the
engine kept boosting candidates matching it.

The soft-delete now covers every copy of the song, and the engine's reader
counts only contexts whose song is still liked, as a backstop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:59:09 -05:00
bvandeusenandClaude Opus 5.5 d1f76167c8 fix(playlists): each daily mix keeps its id across rebuilds (#8081)
The nightly rebuild deleted every system playlist and inserted new rows, so
each mix got a new id every day. A Subsonic app caches, pins, downloads and
syncs a playlist by id, and saw its mixes deleted and recreated daily: a
stored mix answered "not found" and an offline download was orphaned.

The rebuild now refills yesterday's row for the same mix in place (keyed by
kind, plus the seed artist for "Songs like" and the name for a genre mix),
inserts only mixes that are new, and deletes the ones today's build didn't
make, along with their collage files. The rollups move updated_at, which is
the "changed" time Subsonic apps use to see a mix was refreshed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:57:41 -05:00
bvandeusenandClaude Opus 5.5 dbf39f90f8 fix(playlists): a restored playlist draws its collage again instead of showing a broken image (#8105)
A collage is a file in the data directory, which the backup doesn't carry,
but playlists.cover_path travelled, so a restored playlist pointed at a file
that wasn't there and its tile showed a broken image until someone edited it.

- The backup leaves cover_path out, so a restored playlist starts with none.
- The nightly rebuild (and the catch-up at startup) draws each person's own
  playlist collages again from their albums' current covers, so one drawn
  before the art arrived fills in later.
- The cover endpoint draws a collage whose file has gone missing, rather
  than answering 404.
- SetPlaylistCover only bumps updated_at when the path changes, so a redraw
  isn't a change to the playlist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:55:30 -05:00
bvandeusenandClaude Opus 5.5 436a970f7b fix(backup): a restore says Subsonic apps are signed out, and restores ListenBrainz switched off (#8104)
The backup leaves out each person's Subsonic password and ListenBrainz
token, which are sealed under the stream secret, but no restore message
said so. The CLI and docs sent people to Admin for keys that live in each
person's own Settings, and the web said nothing. All three now say that
Subsonic apps are signed out and where to make a new Subsonic password and
save the ListenBrainz token.

listenbrainz_enabled travelled without the token, so a restored account
read as on but unable to send. It is now left out too and restores off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:53:37 -05:00
bvandeusenandClaude Opus 5.5 4c0bd9df04 fix(subsonic): a scrobble's time is bounded as a native play's is (#8076)
The native events endpoint clamps a client's play time to between the
account's creation and a few minutes past now. A Subsonic scrobble took
its time as sent, so an app with a wrong clock dated plays years out,
onto the wrong day in History and into Rediscover's ordering. The clamp
moves to playevents.ClampClientTime and both surfaces use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:52:37 -05:00
bvandeusenandClaude Opus 5.5 408c4f9c24 fix(subsonic): starred songs list only songs the listener can play (#8109)
getStarred and getStarred2 shared the web's liked-songs query, which keeps a
liked song whose file is missing and ignores the listener's quarantine.
Subsonic can't show a song as unplayable, so an app's Favorites offered
songs that failed to stream, or played the copy the listener hid. Subsonic
now reads ListPlayableLikedTrackRows, which filters both before the cap,
as #8020 did for albums, search and genres. The web's list is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:51:42 -05:00
bvandeusenandClaude Opus 5.5 f3997b657c fix(providers): saving a key for an enabled source tries the gaps again (#8102)
A source that needs a key, such as Last.fm, answers "not found" without
one, and the enricher settles each row it tried that way at the current
version. Switching Last.fm on before entering its key settled every gap
without it, and saving the key didn't move the version, so Last.fm never
came back to them. The sources signature now marks each enabled source
that has a key, so a key arriving or leaving moves the version. Replacing
one key with another still doesn't.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:50:29 -05:00
bvandeusenandClaude Opus 5.5 3a7081be19 fix(scrobble): plays that can't be sent no longer block ListenBrainz for everyone (#8103)
The worker skipped a queued play whose account had since switched
ListenBrainz off, or whose token couldn't be read, and left it pending. The
batch is the oldest fifty pending rows, so skipped rows came back first on
every tick, and fifty of them stopped scrobbling for every account. They are
now marked failed with the reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:48:55 -05:00
bvandeusenandClaude Opus 5.5 c6a9535cf7 fix(auth): a password reset signs out Subsonic apps too, and a change can (#8107)
A reset ended every session but left the API key and Subsonic password
working, and anyone signed in to the account can make either. So whoever had
the account kept it through a Subsonic app after the owner reset the
password. The forgotten-password reset and an admin's reset now replace the
API key with one nobody holds and clear the Subsonic password.

A self-service change keeps Subsonic apps signed in by default, since it
would sign out the owner's own apps too. The web and Android password forms
gain "Sign out Subsonic apps too", sent as sign_out_subsonic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:48:21 -05:00
bvandeusenandClaude Opus 5.5 1c28e17dfc fix(auth): one invite makes one account, and a burst of sign-ups can't outrun the limit (#8106)
release / go (push) Successful in 2m8s
release / govulncheck (push) Successful in 19s
release / web (push) Successful in 1m13s
release / integration (push) Successful in 4m7s
release / android (push) Successful in 4m15s
release / Build signed APK (push) Successful in 4m46s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped
Registration inserted the user and only then claimed the invite. When the
claim lost a race it kept the account anyway, so parallel sign-ups on one
invite link each made an account. The insert and the claim now run in one
transaction: RedeemInvite's row lock makes the second sign-up wait for the
first, find the invite used, and roll its account back with invite_invalid.

The register and forgot-password limits checked and counted in two steps,
so a parallel burst all read the count before any attempt was added. They
now call AttemptLimiter.Allow, which does both under the lock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:45:07 -05:00
bvandeusenandClaude Opus 5.5 1b13aa8b7f fix(library): drop the stray zero a tagger writes after every UTF-16 string, not only the last (#8060)
release / go (push) Successful in 2m0s
release / web (push) Successful in 1m10s
release / govulncheck (push) Successful in 21s
release / integration (push) Successful in 4m10s
release / android (push) Successful in 4m56s
release / Build signed APK (push) Successful in 5m13s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 15s
release / Verify release artifacts (tag releases only) (push) Skipped
The first repair trimmed one stray zero at the end of a UTF-16 frame. The
same tagger writes one after every string, so a custom field (TXXX) such
as ARTISTS or REPLAYGAIN carries one between its name and its value as
well, and dhowden/tag still refused those files. Zeros between a
terminator and the next byte order mark, or the end of the frame, are now
dropped too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 15:52:03 -05:00
bvandeusenandClaude Opus 5.5 c9e058b3c9 fix(library): a UTF-16 tag frame with a stray trailing zero no longer hides the whole file (#8060)
release / go (push) Successful in 2m4s
release / web (push) Successful in 1m21s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m9s
release / android (push) Successful in 4m28s
release / Build signed APK (push) Successful in 4m56s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 14s
release / Verify release artifacts (tag releases only) (push) Skipped
Some taggers end a UTF-16 text frame with a two-byte terminator and then
one more zero byte, so the frame holds an odd number of bytes.
dhowden/tag refuses the whole tag when it meets one, and the scanner
then skipped the file: 61 tracks on dev (whole albums from one tagger,
with a genre or year frame written this way) never reached the library.

internal/tagread.ReadFrom reads with dhowden/tag first. When that fails
on an ID3v2.3/2.4 tag, it rebuilds the tag in memory with the stray
byte trimmed from each such frame and reads it again. Anything else
still fails with dhowden/tag's own error. The scanner, both MBID
backfills, embedded cover art and Subsonic lyrics all read through it.

The ID3v2 primitives (syncsafe and frame sizes, the extended header,
unsynchronisation) move from library/id3v2genre.go into tagread, so the
genre reader and the repair share one copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 14:05:55 -05:00
bvandeusenandClaude Opus 5.5 17a9052acb refactor(api): the cover-source and tag-source admin cards share their handlers (#8002)
release / web (push) Successful in 1m16s
release / go (push) Successful in 1m49s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 3m56s
release / android (push) Successful in 4m8s
release / Build signed APK (push) Successful in 4m29s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 13s
release / Verify release artifacts (tag releases only) (push) Skipped
admin_cover_sources.go and admin_tag_sources.go were the same list,
update and test handlers over two settings services, each with its own
copy of the response mapping. With both services now a
providers.Service, admin_provider_sources.go holds the handlers and wire
types once, and each family's routes pass their own service. The wire
shape is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 13:01:48 -05:00
bvandeusenandClaude Opus 5.5 d8abc457e7 fix(providers): Last.fm's rate limit retries art later, and both Last.fm sources share one pace (#8002)
The cover-art Last.fm provider read every JSON error code as "no art",
so a burst of rate-limit (29) or service-unavailable (8, 11, 16)
answers marked albums and artists as having nothing on Last.fm. The tag
provider already retried those. providers.LastfmError is now the one
mapping, used by both.

Each family also paced Last.fm on its own at 4 requests a second, so
together they could reach 8 a second against the 5-per-key limit when
an admin uses one key for both. Both now wait on providers.LastfmPacer.
The client's own spacing is a providers.Interval, so a pace can be
shared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 13:00:51 -05:00
bvandeusenandClaude Opus 5.5 b901560edf refactor(providers): one paced, retrying HTTP client for cover art and tags (#8002)
coverart/httpclient.go and tags/httpclient.go were the same client:
pacing, exponential backoff with jitter, 401/403-as-transient, body
caps. Tags had added a User-Agent and a shared Pacer, cover art an image
GET. providers.HTTPClient now has all of it, with the tests that were in
coverart. ErrTransient is shared too, so both families' errors.Is still
match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:58:55 -05:00
bvandeusenandClaude Opus 5.5 487e11f59f refactor(providers): cover art and tags share one registry and settings service (#8002)
coverart and tags each carried a line-for-line copy of the provider
registry and the settings service: reconcile at boot, seal and reveal
API keys, bump the sources version when the enabled set or the
registered set changes. A fix to either had to be made twice.

internal/providers now holds Registry, Service (over a small Store
interface) and EnabledAs[T]. Each family keeps its own tables, provider
set and capabilities: a 40-line Store adapter over its sqlc queries and
its capability views (EnabledAlbumProviders, EnabledTrackTagProviders).
Provider, ProviderSettings, TestableProvider, ProviderInfo and
ProviderUpdatePatch stay as the families' names for the shared types.
The service has unit tests over an in-memory store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:57:19 -05:00
bvandeusenandClaude Opus 5.5 58fb2bbe9d refactor: drop code nothing calls, and the sync log rows no app reads (#8002)
release / go (push) Successful in 1m56s
release / web (push) Successful in 1m18s
release / govulncheck (push) Successful in 19s
release / android (push) Successful in 4m20s
release / Build signed APK (push) Successful in 4m52s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / integration (push) Successful in 4m0s
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped
- library.ProbeDurationMs and IsAudioFile, and db.MigrationsFS, had no
  callers.
- The delta sync logged and hydrated like and playlist changes on every
  like, playlist edit and duplicate merge, including a GetPlaylistsByIDs
  query per sync. Android applies only artists, albums and tracks, and
  the web doesn't sync; likes and playlists reach both through their own
  endpoints and live events. The like and playlist-entry deletes also
  went to every caller unscoped, user ids included. They are no longer
  written or served, and migration 0112 clears the rows already logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:52:35 -05:00
bvandeusenandClaude Opus 5.5 39fa740bff test: one test-database opener, dbtest.Pool, in place of 39 copies (#8002)
Every package carried its own testPool/newPool/newTestPool: skip under
-short or without MINSTREL_TEST_DATABASE_URL, migrate, connect,
register the close, and usually ResetDB. dbtest.Open does the first
four (migrating once per test binary) and dbtest.Pool adds the reset.
The per-package wrappers that did nothing else are gone; fixture
helpers that seed rows keep their own signatures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:49:02 -05:00
bvandeusenandClaude Opus 5.5 47e749225e refactor(recommendation): both candidate pools score through one listener context (#8002)
LoadCandidates and LoadCandidatesFromSimilarity each loaded contextual
likes, the taste profile and context affinity, and each built
ScoringInputs field by field, so a new scoring input added to one pool
would be missing from the other. loadScoringContext loads them once
and scoringContext.inputs builds every candidate's inputs; the
similarity pool adds its similarity score on top.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:46:44 -05:00
bvandeusenandClaude Opus 5.5 55a290cf4d refactor(coverart): one image Content-Type table for /api and Subsonic (#8002)
api/media.go and subsonic/stream.go each had imageContentType, the
same map in a different order, serving the same files.
coverart.ImageContentType is now the one copy, with its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:45:50 -05:00
bvandeusenandClaude Opus 5.5 074d9ffb0e refactor(api): one password rule, one hash, one unique-violation check (#8002)
The length check and bcrypt call were copied into sign-up, reset,
change and both admin paths; the unique-violation test into three api
handlers and the library. checkNewPassword and hashPassword now sit in
api/prelude.go, and db.IsUniqueViolation serves api and library. The
taken-username and taken-email conflicts now carry a message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:45:18 -05:00
bvandeusenandClaude Opus 5.5 cfdd6b916f fix(subsonic): a handler without a caller answers error 50 everywhere (#8002)
Sixteen handlers answered a missing caller with error 50 "Not
authenticated"; the star, unstar and scrobble handlers answered error 0
"Unauthenticated". Middleware stops such a request first, so no app saw
it, but the next handler copied would pick one at random. requireUser
now holds the check, the same shape as /api's, at all 21 sites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:44:05 -05:00
bvandeusenandClaude Opus 5.5 0811775af6 fix(api): every /api error answers in one envelope, so Android shows the real reason (#8002)
Three error shapes were on the wire: {"error":{"code","message"}} from
writeErr, a flat {"error":"code"} from the admin queues, playback errors
and RequireAdmin, and plain text from RequireUser's 401s. Android reads
only the first, so an admin's quarantine, duplicate or suspect-file
error, and "you're not an admin", all showed "Something went wrong."

apierror.Write is now the one writer, and api.writeErr, RequireAdmin,
RequireUser, the client-APK endpoints, the events stream, the unknown-
route 404 and the admin scan all go through it. The flat writers are
gone, and the web client drops its second branch. The admin codes keep
their names; each now carries a message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:43:27 -05:00
bvandeusenandClaude Opus 5.5 125099ede2 fix(server): a background job that panics no longer stops the server (#8002)
release / go (push) Successful in 2m6s
release / web (push) Successful in 1m25s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m18s
release / android (push) Successful in 4m19s
release / Build signed APK (push) Successful in 4m56s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 30s
release / Verify release artifacts (tag releases only) (push) Skipped
Background jobs run in their own goroutines, outside the router's panic
recovery, and only five of them recovered. A panic in the scrobble,
similarity, co-play, gc, tags, compactor, notification, backup or
safety-net loop, or in a scan or rebuild started off a request, ended
the process and every stream in it.

internal/periodic now runs each job: a pass at start (or after one
interval, Delayed), then one per interval and on any WakeOn channel,
each pass under recover with the stack logged. Detached one-shot work
(scans, the lazy system-playlist build, bulk cover refetch, leveled
prerender, the backup run, the playlist catch-up) runs under
periodic.Safe. The duplicate resolver keeps its own loop for its
retry-soon timer, and its pass already recovers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:38:56 -05:00
bvandeusenandClaude Opus 5.5 a77f3ae6ff feat(playlists): changes a phone queues offline are safe to send twice (#8023)
release / go (push) Successful in 1m59s
release / web (push) Successful in 1m23s
release / govulncheck (push) Successful in 22s
release / integration (push) Successful in 4m38s
release / android (push) Successful in 4m45s
release / Build signed APK (push) Successful in 5m22s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 17s
release / Verify release artifacts (tag releases only) (push) Skipped
- A new playlist can carry the client's own id; sending the create
  again finds the same list.
- Removing a song can name the song expected at that position; if
  another song is there now, nothing is removed (409 list_changed).
- A reorder can give the songs in their new order (track_ids); sending
  it again changes nothing.
- The playlist service tells the owner's clients about every change
  itself, so a change made from a Subsonic app refreshes the web and
  Android apps too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 10:22:40 -05:00
bvandeusenandClaude Opus 5.5 1df91678ba fix(subsonic): someone else's private playlist reads as absent when an app tries to change it (#8021)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 10:22:40 -05:00
bvandeusenandClaude Opus 5.5 df2095baae feat(subsonic): apps can make, change and delete playlists (#8021)
release / web (push) Successful in 1m43s
release / go (push) Successful in 2m21s
release / govulncheck (push) Successful in 20s
release / integration (push) Failing after 4m31s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 2m44s
release / android (push) Canceled after 3m43s
createPlaylist makes a playlist, or with playlistId replaces its songs;
updatePlaylist renames it, sets its comment and visibility, removes songs
by the index the app was shown and adds songs; deletePlaylist deletes it.
A song index counts only the entries getPlaylist lists, so a hidden
entry ahead of it doesn't shift which song goes.

The playlist service gains ReplaceTracks and RemovePositions; the owner
and system-mix checks that each change repeated are one function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 10:17:15 -05:00
bvandeusenandClaude Opus 5.5 3491cf4c58 feat(admin): switches for ListenBrainz similarity and MusicBrainz track lists
release / go (push) Successful in 1m50s
release / web (push) Successful in 1m15s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m11s
release / android (push) Successful in 4m33s
release / Build signed APK (push) Successful in 4m40s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 22s
release / Verify release artifacts (tag releases only) (push) Skipped
Both lookups ran with no way to stop them. Admin › Metadata sources now
has an "Other lookups" group with a switch each, both on by default
(lookup_settings, migration 0111). Off, the similarity worker asks
ListenBrainz nothing and still links what it already fetched; the
duplicate resolver gets ErrLookupOff and decides from the track lists it
already has. The setting is backed up, and docs/security.md names the
switches. docs/security.md also says every account but the first needs an
invite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 08:59:25 -05:00
bvandeusenandClaude Opus 5.5 1942cb39cf test: example addresses come from the documentation range
Sonos, UPnP and public-address tests used addresses from a real home
network. They now use 198.51.100.x (RFC 5737), keeping the last number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 08:59:25 -05:00
bvandeusenandClaude Opus 5.5 dd27e014c0 fix(auth): an invite is the only way to an account
The README offered open registration, and the register handler still had
a branch for a registration_settings mode nothing could set. Now every
account after the first needs an invite; the first still needs the setup
token from the log. Migration 0110 drops registration_settings and its
queries, and backups no longer carry it (an older backup that holds it
restores without it). The web form asks for the invite token as required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 08:59:25 -05:00
bvandeusenandClaude Opus 5.5 de335333da test(subsonic): a library download by search3 leaves out the missing song
release / web (push) Successful in 1m18s
release / go (push) Successful in 1m46s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 3m56s
release / android (push) Successful in 4m15s
release / Build signed APK (push) Successful in 4m46s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 23s
release / Verify release artifacts (tag releases only) (push) Skipped
The fixture's C has a missing file, and search3 now lists only what the
listener can play, as getAlbumList2 already did with the same fixture.
The paging test expected the old behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:13:00 -05:00
bvandeusenandClaude Opus 5.5 14aa3dcd5e chore: remove code left from acquisition and Discover suggestions, and uncalled queries
Nothing reached any of it:
- MusicBrainz search (artists, albums, songs), artist lookups and the
  query escaping they used. The release-group lookups the duplicate
  resolver uses stay.
- Release-group covers, and artist-level tags for artists not in the
  library.
- Nine named queries with no caller (CountTracksByArtist went with the
  previous commit), two of them describing request-progress reporting.

The MusicBrainz client's retry and not-found tests now drive the
release-group lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:02:00 -05:00
bvandeusenandClaude Opus 5.5 785b15ab5f fix(library): a scan cut off by a restart no longer blocks saving library folders
A restart mid-scan left its scan_runs row unfinished, and saving library
folders refused ("A library scan is running") until a later scan reaped it,
up to 12 hours on. Startup now closes such rows with the reason before the
boot scan, as backups already do. Saving folders and the duplicate sweep
share one check that treats a run past StuckScanThreshold as dead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:02:00 -05:00
bvandeusenandClaude Opus 5.5 1ff4bc8258 fix(subsonic): albums, folders and search list only what the listener can play
getAlbum, getMusicDirectory and search2/3 ignored the listener's quarantine
and listed missing files, which an app then failed to stream; song counts
counted both. They now pass the listener and leave out missing files, as
the mixes already did. Subsonic can't mark a song unplayable, so leaving it
out is how the native apps' greyed-out row comes across.

Song search filters in SQL (SearchPlayableTracks), so a library sync paging
through search3 never gets a short page that reads as the end. Album song
counts come from one query for the whole page (CountPlayableTracksByAlbums)
instead of one per album.

tracks.sql also drops CountTracksByArtist, which nothing called; see the
next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:02:00 -05:00
bvandeusenandClaude Opus 5.5 d0675e1817 fix(android): a device's cached data stays with the account that made it
Queued offline writes, Home, history, the quarantine list, notifications and
the resume queue carry no user id, and nothing cleared them when someone
signed out. The next person to sign in on a shared phone inherited them,
and the queued likes and plays were sent under their session.

The cached data now has an owner (Room v15, auth_session.cacheOwnerUserId).
When a different account signs in, AccountCache clears those tables in one
transaction and empties the player before adopting it. The replayer only
sends queued writes while their owner is signed in. The same person signing
back in, after a sign-out or an expired session, keeps everything. Signing
out from Settings sends what is still queued first, for up to five seconds.

An install updated from before this adopts whoever is signed in, keeping
their data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:02:00 -05:00
bvandeusenandClaude Opus 5.5 333523b30e fix(subsonic): one listen is one play, and a daily mix played in a Subsonic app is credited to it
release / web (push) Successful in 1m23s
release / go (push) Successful in 1m55s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m16s
release / android (push) Successful in 4m50s
release / Build signed APK (push) Successful in 5m29s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 17s
release / Verify release artifacts (tag releases only) (push) Skipped
A Subsonic app reports "now playing" when a song starts and "played" when
it ends. The played report used to close the now-playing row as a play of
its own and write a second one, so every listen counted twice, and as a
skip when the app sent the song's start time. The report now completes the
app's own row for that song. A late report for an earlier song no longer
cuts short the song playing now.

Subsonic's scrobble doesn't say where a song was played from, so Minstrel
remembers, per user and app, the daily mix the app last opened (for six
hours). A play of a song in that mix is credited to it: the mix's metrics
count it and its rotation moves on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:48:17 -05:00
bvandeusenandClaude Opus 5.5 7f7e946bad feat: artist pictures in the web and Android apps
release / web (push) Successful in 1m59s
release / go (push) Successful in 2m23s
release / govulncheck (push) Successful in 22s
release / integration (push) Successful in 4m59s
release / android (push) Successful in 5m29s
release / Build signed APK (push) Successful in 6m26s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 31s
release / Verify release artifacts (tag releases only) (push) Skipped
Minstrel fetched artist pictures but showed them only to Subsonic apps.
GET /api/artists/{id}/image now serves the picture, or else the artist's
newest album cover, the same image Subsonic apps get. Artist listings
point at it when the artist has a picture and keep the album cover
otherwise; the artist page points at it whenever the artist has albums,
and the web artist page shows it beside the name.

Android shows the picture for cached artists that have one, and the
album cover for the rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:32:55 -05:00
bvandeusenandClaude Opus 5.5 1965e82013 feat(subsonic): artist pictures in Subsonic apps
release / go (push) Successful in 1m47s
release / web (push) Successful in 1m10s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m3s
release / android (push) Successful in 4m27s
release / Build signed APK (push) Successful in 5m2s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 17s
release / Verify release artifacts (tag releases only) (push) Skipped
getCoverArt now answers an artist's id: the artist picture Minstrel
fetched, when its file is there, or else the cover of the artist's most
recently added album that has one, which is what Minstrel's own artist
cards show. Every artist entry carries its id as coverArt, so apps ask.

The lookup is coverart.ResolveArtistPath, beside the album one, and looks
through at most ten of an artist's albums for a cover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:20:30 -05:00
bvandeusenandClaude Opus 5.5 6dfa7b25fb fix(subsonic): the lint findings in artist info and the lyrics handler name
release / go (push) Successful in 2m1s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m11s
release / web (push) Successful in 1m20s
release / android (push) Successful in 4m23s
release / Build signed APK (push) Successful in 5m11s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 16s
release / Verify release artifacts (tag releases only) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:48:57 -05:00
bvandeusenandClaude Opus 5.5 f87aba5b86 feat(subsonic): scan status, artist and album info, lyrics, ratings and users
release / go (push) Failing after 1m15s
release / web (push) Successful in 1m18s
release / govulncheck (push) Successful in 21s
release / integration (push) Successful in 3m57s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / android (push) Canceled after 4m33s
release / Build signed APK (push) Canceled after 4m9s
The last Subsonic methods apps call that Minstrel didn't answer:

- getScanStatus counts the songs whose files are present and says
  whether a scan is running; startScan, for an admin, starts the scan the
  web app's Rescan starts, and answers "scanning" straight away since the
  scan records itself a moment later.
- getArtistInfo and getArtistInfo2 give the artist's MusicBrainz id and the
  artists in this library that sound like them, from an artist, album or
  song id; getAlbumInfo and getAlbumInfo2 give the album's MusicBrainz id.
  Minstrel fetches no biographies or outside images, so none are sent.
- getLyrics (by artist and title) and getLyricsBySongId (OpenSubsonic
  songLyrics, now declared) read lyrics when asked: a .lrc file beside the
  song gives timed lyrics, otherwise the song's own lyrics tag.
- setRating accepts a rating and keeps none: a like is Minstrel's only
  rating, and a low rating is never read as a dislike.
- getUsers lists every user, for an admin only.

ArtistRef no longer fixes its XML element name, so it can appear as
similarArtist; every field holding it names the element.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:43:13 -05:00
bvandeusenandClaude Opus 5.5 b801f81058 feat(subsonic): an artist's top songs, and the play queue carried between devices
release / go (push) Successful in 1m50s
release / web (push) Successful in 1m14s
release / govulncheck (push) Successful in 44s
release / integration (push) Successful in 4m11s
release / android (push) Successful in 6m15s
release / Build signed APK (push) Successful in 7m51s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped
getTopSongs ranks the named artist's songs by how often they were played
through on this server, then by likes, then in album order, so an artist
nobody has played yet still has songs to offer. Missing files and the
listener's quarantined songs are left out.

savePlayQueue keeps one queue per listener: the songs in order, the one
playing, how far into it, and the app that saved it. getPlayQueue gives it
back to that listener only; a song no longer in the library drops out.
Saving no songs clears it. The queue lives in a new play_queues table,
which backups carry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:03:29 -05:00
bvandeusenandClaude Opus 5.5 8731e9695a feat(subsonic): browse by genre and by folder
release / web (push) Successful in 1m16s
release / go (push) Successful in 1m47s
release / android (push) Successful in 4m30s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 3m59s
release / Build signed APK (push) Successful in 4m56s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 15s
release / Verify release artifacts (tag releases only) (push) Skipped
Subsonic apps can now list genres and play one (getGenres,
getSongsByGenre), and apps that browse by folder, such as DSub, can open
an artist to its albums and an album to its songs (getMusicDirectory),
with the album lists and search they use in that mode (getAlbumList,
search2).

Genres are split and counted as the web's genre index counts them, now
with an album count beside the song count. A genre's songs leave out the
listener's quarantined ones and missing files. Folders are Minstrel's
artists and albums, under the same ids as the tag-based calls.

getAlbumList2 and search3 now share their selection with the folder
versions, so the two modes list and find the same things.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:40:21 -05:00
bvandeusenandClaude Opus 5.5 da64d95264 test(subsonic): read similar songs from their own keys, not a map over the whole response
release / web (push) Successful in 1m30s
release / go (push) Successful in 1m59s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m18s
release / android (push) Successful in 4m37s
release / Build signed APK (push) Successful in 5m13s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 14s
release / Verify release artifacts (tag releases only) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:34:20 -05:00
bvandeusenandClaude Opus 5.5 bb2897dfd5 feat(subsonic): playlists and daily mixes, the weighted shuffle, and radio
release / go (push) Successful in 2m0s
release / web (push) Successful in 1m23s
release / govulncheck (push) Successful in 20s
release / integration (push) Failing after 4m23s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 2m8s
release / android (push) Canceled after 3m38s
Subsonic apps now get what Minstrel picks, not only what it holds:

- getPlaylists lists the listener's daily mixes first, then their own
  playlists, then other people's public ones; getPlaylist returns the
  playable songs in order, as <entry> elements in XML.
- getRandomSongs answers with the weighted shuffle (likes up, skips down,
  the last hour's plays out), narrowed by genre and release year.
- getSimilarSongs and getSimilarSongs2 answer with Minstrel's radio, seeded
  from a song, or from a random song of an album or artist.

Radio's selection moves out of the /api/radio handler into
recommendation.Picker, built by recsettings.Service.Picker, so the web and
Android apps and the Subsonic apps pick through one piece of code and one
tuning. SongRef loses its XMLName so the field holding it names the element.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:25:49 -05:00