An app that asks for lyrics by title without an artist got the first
matching song with lyrics, which could be another artist's song of the
same name. It now answers empty, so the app can look elsewhere.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
seedTrack derives the file path from the title, so two copies titled
alike upserted into one row and the test compared a track with itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three more assertions in likes_test.go still expected 204 from the track
like and unlike routes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MusicBrainz, the Cover Art Archive and AcoustID ask a client to name
itself with a version and a contact. Minstrel sent three different
strings: Minstrel/1.0 to MusicBrainz, Minstrel/dev to the Cover Art
Archive and no version at all to AcoustID, whatever the build. All three
now come from buildinfo.UserAgent, which carries buildinfo.Version and
the operator's contact address when one is configured, else the project
URL. ProjectURL is that one place to repoint when the project moves
(#7897).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The taste build graded every play in its window, and a play with no
completion ratio and no played duration came out as completion 0: a song
playing during the rebuild, or a row the sweeper closed without hearing
how it ended, counted as abandoned and pushed its artist and tags
negative. Only plays whose completion is known are graded now; an open
play is graded once it ends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A like is on the song: the server likes every copy sharing its song_key,
but the web's optimistic update marked only the tapped track, so the
same song on another album or a compilation showed an empty heart until
the liked ids were fetched again. A track like or unlike now answers 200
with the ids of every copy it changed, the asked one first, and the web
marks them all. Clients that ignore the body (Android) are unaffected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A scrobble whose id named no track reached the play writer and came back
as a generic failure (0). The handler now looks the song up first, as
stream does, and answers 70 with nothing recorded; a lookup that fails
for another reason is still a generic error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HomeData loads its seven sections in bare goroutines joined by a
WaitGroup. A panic in one of them was off the request's goroutine, out
of the HTTP recoverer's reach, and would stop the whole server. The
sections now run through one helper that recovers a panic into that
section's error, with the stack, so the call fails as a query error
fails it. They stay request-scoped: each uses the request's context and
the call waits for all of them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The name, comment, removals and additions are separate writes, and the
songs to add were only found missing when the last of them ran, so an
unknown songIdToAdd answered error 70 over a playlist already renamed
and trimmed. Every song to add is now looked up first, alongside the
index check, and an unknown one answers 70 with nothing changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An append that reached the server but whose reply never reached the
phone stayed in the offline queue and was sent again, and since an
append is an action, the song landed twice. Android now names each
append with a request id, carried by the live send and its queued row
alike; POST /api/playlists/{id}/tracks takes it as request_id, and the
server records it per playlist in the append's own transaction
(playlist_append_requests, pruned after 30 days). A send whose id is
already recorded changes nothing; a failed append rolls its id back
with it. Without an id an append behaves as before, so queued rows
from older builds and Subsonic clients are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ten Android covers wrote out the same muted icon for missing artwork;
they now call CoverFallbackIcon beside CoverTile, and ShelfPlaylistCards'
NoArtIcon wrapper is gone. AlbumDrillDown and AlphaLibrary each declared
the infinite-query shape they read; both now take PagedQuery<T> from
api/types. Folds the two small copies the M664 DRY close-out found (#8006).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Android's ErrorCopy was a hand-kept copy of web/src/lib/styles/
error-copy.json that had drifted: 14 of the web's codes were missing
(a server shutting down, a bad setting value, the backup and duplicates
codes), so those read "Something went wrong." on the phone, and only 2
of the web's 7 codes appended the server's specifics.
Now app/build.gradle.kts copies error-copy.json and a new
error-detail-codes.json (the list web/src/lib/api/errors.ts kept
inline) into the app's Java resources, and ErrorCopy reads them. The
three codes only Android had (auth_required, not_found,
cleartext_public) move into the shared file. PasswordRules' too-short
line is the shared password_too_short copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings › Password said "New passwords do not match." where the web
says "Passwords do not match.", and neither it nor an admin resetting
someone's password checked the 8-character minimum before sending: the
reset button lit up after one character. auth/PasswordRules mirrors
web/src/lib/auth/password.ts: the minimum, the "At least 8
characters." hint under the field, the too-short and mismatch wording.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Previous always went back a song. It now does what the web player
does: past the first 3 seconds it starts the current song over, and
before that it goes back one. It greys out only in the opening seconds
of the queue's first song. PlayerController decides it, so a cast to a
Sonos speaker behaves the same: the restart is a seek to 0 there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleting a playlist asked in the browser's own confirm() box and
reported errors with alert(). Four other deletes each built Modal +
Cancel + a destructive button by hand, two of them in bronze rather
than the destructive oxblood. Suspect sources removed a file on a
second click while Reports asks in a dialog for the same act.
ConfirmModal is the web's twin of Android's ConfirmDestructiveDialog:
title, a body saying what goes, Cancel, and a confirm button in the
destructive action colour that can show a busy label. Reports (x2),
Needs a file, Admin > Users, the playlist page and Suspect sources use
it. The playlist page's errors go to toasts. A source guard keeps
confirm() and alert() out of the app; it flags the old playlist page.
The two web source guards share lib/testing/sourceGuard.ts.
ListenBrainz status (Settings > Connections) and the recommendation
metrics now offer Try again when they fail to load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The playlist card, the playlist header and the playlist a mix was
started from said "${n} tracks" whatever n was. Seven count labels
were each written by hand; they now go through shared/plural(), which
also formats the number for the listener's locale, as the web's counts
do. PluralTest names any hand-written copy (checked against the tree
before this change: it flags all seven).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SendOrQueue.kt is named for its one class, WriteOutcome.kt.
toggleTrackLike becomes an extension on LikesRepository, keeping the
class under the function cap. A long test line is split.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The password reset, the new-music and activity summaries and the SMTP
test message each drew their own page; the test message had no layout
at all. They now share internal/mailer's layout: the Minstrel name at
the top, the email's heading and message on a card in the design
system's dark theme, and a footer saying which server sent it and why,
signed "— Minstrel", with the notification-settings link on the
summaries. A plain-text body in the same frame goes alongside.
An email supplies only its content templates and a Frame (heading,
server, reason). Links, buttons and quiet text take named styles from
the layout ({{style "link"}}), so colours change in one place; an
unknown style name fails the render. The SMTP test message is a
template now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The A1 edit that moved the Most played cover onto TrackCoverThumb
matched the skeleton tile's cover box first and cut from there to the
real tile's body, dropping CompactTrackTile's header. The skeleton keeps
its plain placeholder box; the real tile uses TrackCoverThumb.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Six repositories decided for themselves which failed writes to queue:
playlists queued only on no answer, notifications split 4xx from 5xx,
and likes and hidden tracks queued everything, a refusal included, which
the replayer then sent again only to drop it.
They all go through cache/mutations/sendOrQueue now: no answer, a 5xx,
408 or 429 queue the write; any other 4xx is a refusal and is not
queued (playlists still throw it so the screen can say why; the others
log it). Cancellation passes through. isRetryableStatus is the one test
of a retryable status, and the replayer's isPermanent is its complement.
WriteOutcome moves to cache/mutations and gains Refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Users, Reports, Tag sources and the admin landing each declared their
own Loading/Empty/Success/Error sealed interface and the same
try / list / isEmpty / catch-into-ErrorCopy refresh. They use the shared
UiState<T> now (kept as typealiases for their state types), loading
through two new helpers in shared/UiState.kt: loadUiState, which turns a
failure into Error and lets cancellation through, and List.toListState,
which gives Empty for an empty list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Album detail, playlist detail and the player each flipped a track's like
with the same lines (desired = id !in likedTrackIds; toggleLike(TRACK…)).
They call toggleTrackLike(trackId, likedIds) now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Home's artist tile and the Artist page's Play each fetched the artist's
tracks, shuffled and queued them, with their own copy of the error
handling and different words for an empty artist ("This artist has no
tracks to play." vs "No tracks to play for this artist."). Both call
library/data/LibraryPlayback.kt's shufflePlayArtist now, beside
playAlbumFromStart for Home's album tiles, the way PlaylistPlayback
serves the playlist tiles.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove the file / Remove from library, Delete user, Clear cache and Sign
out each drew their own AlertDialog, coloured four ways: a plain text
button, error-red text, an error-red button and an error-container
button. They now use the shared ConfirmDestructiveDialog, whose confirm
is the destructive action colour. It gains an optional confirmWord, a
word to type before confirming, which Delete user keeps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Profile card showed its form once loading stopped, whether or not
the load had worked. After a failed load the name and email fields were
empty and Save was enabled, so saving wrote blanks over the real
profile. ListenBrainz had the same shape.
Both cards now go through SettingsLoad: a spinner while loading, one
settings row with Try again when the load failed, and the form only
once the data is in. The view models keep a load failure in loadError,
apart from the form's save message. The web's cards do the same
(SettingsLoadStatus).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three covers loaded art outside the shared ServerImage: the playlist
header and Most played tile used Coil's AsyncImage directly, and the
album header passed ServerImage no fallback. A failed load left a blank
box. They now go through CoverTile / TrackCoverThumb, which show the
placeholder glyph while loading and when the load fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>