The mini player and Now Playing each drew their own play/pause button
with its UPnP loading spinner, and their own Previous/Next. They share
TransportControls.kt now (PlayPauseButton, SkipButton). PlayerUiState
gains hasPrevious/hasNext from Media3's hasPrevious/NextMediaItem, and
both screens disable the skip buttons when there is nowhere to go, as
the web does.
The cover's shared-element hero modifier, also written twice, is one
nowPlayingCoverHero().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Android played the visible search results as a queue; the web started
radio. Both now start radio seeded from the tapped track: the song plays
first, then songs like it. Android falls back to playing the track alone
when radio can't be had (offline, or an empty answer).
The web's two identical onTrackPlay handlers (search and search/tracks)
become one, radioFromRow. PlayerController gains playRadio, which
replaces the queue; the track menu's startRadio still keeps the current
song playing and queues radio after it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "what is waiting, how long, Open" row was written out four times: the
failed scan, each queue and each status problem on the Overview, and each
queue on the Collection. NeedsYouRow draws it once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two pages matched line for line apart from the noun, the filter field
and the sort key: the count, the quick filter, the lettered grid paged as
you scroll, the admin and listener empty states, and the "search the full
library" link when the filter matches nothing loaded. AlphaLibrary now
draws them once and each page supplies its query, noun, match, key and
card.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three areas each repeated the same title, left rail and content grid.
SectionLayout now draws it once, with the rail and any lines under the
title as snippets.
Admin pages now get the content cap Settings has (max-w-[100rem]): both lay
their groups out in SettingsColumns, and without it Admin's two columns
stretched across a very wide screen. The Collection keeps its uncapped
lists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Fingerprinting card's load-failure line pointed Try again at a load()
that no longer exists, and canSave closing over a value derived from the
form left TypeScript unable to type the form itself. Try again calls
f.load, and canSave states that it returns a boolean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four test files defined the same Page<T> envelope helper; they now import
it from test-utils/fixtures/page.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The genre and year drill-downs hand-rolled their own pager (a request token
to drop late answers, loading, failed and later-page-failed flags), on the
note that the codebase had no way to make a query from a changing URL. The
search pages have since done exactly that:
$derived(q ? createXInfiniteQuery(q) : null).
browse.ts gains createAlbumsByGenreInfiniteQuery and
createAlbumsByYearInfiniteQuery, keyed per selection so a late page for the
previous one never lands in the current list. Both pages draw their albums
through one AlbumDrillDown view (back link, count, grid, ListContinuation),
and the out-of-date note is gone. Tests drive the pages through
mockInfiniteQuery, as the search pages' do, with the page() fixture now in
test-utils.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ⋮ trigger, its popover and the close-on-outside-click and Escape
handling were hand-rolled in AlbumMenu, ArtistMenu, TrackMenu, PlaylistCard
and RowActionsMenu. KebabMenu now draws them once; each menu supplies its
items and any popover it opens (Add to playlist, Report a problem).
AlbumMenu and ArtistMenu were the same menu apart from their entity and
"Go to artist"; both are now CollectionMenu with the entity filled in. Its
track cache is kept per entity id, so a menu reused for another row
fetches that row's tracks. Escape now also closes the playlist card's menu
and the mobile row menu with focus inside it. IconProp is exported once,
from TrackMenuItem (W10).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 8-character minimum was written into sign-up, reset, Settings › Account
and Admin › Users as minlength="8" and a message, and each page mapped
password_too_short, username_invalid and username_taken to its own copy of
the same sentence. lib/auth/password.ts now holds the minimum, the hint and
"Passwords do not match.", and the pages take an error code's wording from
the shared error copy (knownCopy), falling back to their own.
username_invalid's shared copy now states the rule (3–32 characters:
letters, numbers, underscores, hyphens), as the pages did, on web and
Android alike. Account's mismatch line reads "Passwords do not match." like
the other forms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Five settings cards (Fingerprinting, Loudness, Public address, Proxies,
Notification email) each hand-rolled the same cycle: load into a stored copy
and an editable one, say when they differ, save, adopt what the server
stored, toast. lib/settings/settingsForm.svelte.ts now runs it once
(createSettingsForm), and SettingsLoadStatus draws the "Loading…" / "Couldn't
load … Try again" line for those five and for Library folders and AcoustID.
The Proxies card dropped the server's reason when a save was refused and
toasted a fixed "Couldn't save proxy depth."; it now says why, as the other
cards do. Two cards' "Loading <thing>…" lines now read "Loading…" like the
rest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seven places drew their own cover image. The Missing, Suspect sources,
Hidden and Reports rows showed a Music2 icon only when the track had no
album; a cover that failed to load (not fetched yet, or gone) showed a
broken image. The queue row, play bar and Now Playing each set the
placeholder in their own onerror, and the playlist card's images had no
fallback at all.
Cover gains fallback="track" (the Music2 icon a track row uses), and all
seven go through it, so each one handles a missing src and a failed load
the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With repeat one on the last track, the play bar and Now Playing enabled
Next, but store.skipNext treats an explicit Next at the end the same for
repeat one as for repeat off: it pauses. The button now follows the store:
on when there is a track after this one or the queue wraps (repeat all).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PlayerBar and the Now Playing page each carried their own copy of when
Previous and Next are enabled, the repeat label, the volume icon and the
range-input handlers, and the 3-second "restart rather than go back"
threshold was written in both and again in store.skipPrev.
lib/player/controls.ts now holds them once (canSkipPrev, canSkipNext,
repeatLabel, volumeIcon, inputNumber, RESTART_THRESHOLD_SEC), and the store
reads its threshold from there. Behaviour is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
A toggle went live first and queued only on failure, and the replayer
collapses toggles only among queued rows. So a like queued offline, then an
unlike that reached the server live before the queue drained, ended with
the queued like replaying last: the user's last action lost. A refresh also
replaced the local set with the server's, dropping a queued toggle's state
until it replayed.
- When the queue holds a toggle for the same entity, the new one queues
behind it (as NormalizationRepository already does); the replayer then
sends the newest per entity. Quarantine flag and unflag do the same.
- refreshIds and the quarantine refresh keep what is still queued over the
server's answer (MutationQueue.pendingLikeStates /
pendingQuarantineStates).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
signOut cleared the session cookie before calling /api/auth/logout, so the
logout went without the cookie that names the session to drop, and the
server session lived on until it expired. The app still shows signed-out at
once; the logout now goes first with the cookie, bounded to 5 s and run in
the application scope so leaving Settings can't cancel it, and the cookie is
cleared after it, whether it worked or not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The play reporter keyed a play on the current track id, which repeat-one
and the same song twice in a row never change, so any number of listens
became one play closed at the last loop's position. PlayerController now
counts media-item transitions (Media3 reports a repeat as one) as
PlayerUiState.listenSeq, and the reporter keys a play on (track, listen).
A play_started reply cleared the in-flight flag whichever play it was for.
After a quick skip, song A's late reply cleared the flag song B's start had
set, so skipping B before its reply recorded it offline as well as live.
Each start now carries a token, and only its own play's reply adopts the id
or clears the flag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The events dispatcher keyed a play on the track id, so repeat-one, a
one-track queue on repeat-all, or the same song twice in a row stayed one
play, closed at the last loop's position and usually graded a skip. The
player store now counts listens (player.listen moves whenever playback
starts an item from its beginning) and the dispatcher keys a play on
(track, listen).
play_started's reply was adopted only while still 'playing', and nothing
marked a start in flight, so a stall or pause just after starting threw the
id away and the next 'playing' posted a second start, which closed the
first as a skip. The dispatcher now holds the pending listen and adopts the
reply whenever that listen is still current.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
The replay loop's per-row choice moves to replayRow, so the loop has no
continue. The playlist detail's top bar and the playlists list's body
move into their own composables. ReorderableRow.kt is named for its row,
not for ReorderHandles, its parameter type.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>