- base radius from 10px to 4px; one value (--radius in src/index.css) sets every corner
- no fully round shapes any more: play button, search box, pills and artist photos are squares with small corners
- The gate now comes after what only the database decides (a seed that is not an
artist, no seed and no permission), so those answers are not held up by three
slow Discovers and do not make the listener "busy".
- A request that waits more than 30 seconds for a turn answers 429 instead of
hanging for as long as the providers are slow.
- The spec and the README say that a waiting request counts as running.
- the player bar stays at the bottom on long pages (sticky sits on its wrapper, not on the bar)
- theme and language groups in Settings have a visible label
- on a phone the menu is a row of links instead of a tall card, and the privacy note is left out there
- the full-screen player is centred vertically
Found by running the app in a real browser against a real server.
A cold Discover can make dozens of provider requests, and nothing stopped one
listener, or a client that keeps opening and cancelling requests, from lining up
work for the providers and slowing everyone else's.
- A listener who already has a Discover running gets 429 `discover_busy` with
Retry-After, at once.
- At most three Discovers run at the same time, whoever asks; the others wait for
their turn, and one that stops waiting does no work and keeps no place.
- The place and the turn are given back when a Discover fails or ends.
- Spec and README describe it; the fakes of the tests are safe for parallel runs.
- the token is renewed in the background when under 3 minutes are left, so the stream URL of the next track is never built from an expired token
- a renewal adopts a session from another tab only when it differs from the one in memory
- listen keys no longer need crypto.randomUUID, which does not exist on pages opened over plain HTTP on a local network
- signing out, or closing the app, stops the music and empties the queue, and the play in progress is reported first
- a provider address that is not an http(s) address is shown as text, never as a link
- README section for the web client: how to run it next to sondad, what it does today, the commands
- the greeting on Home is read once per visit (lint: no Date during render)
- checked against a real sondad: login, renewal and spent refresh tokens, media URLs with Range, listens, search, and the provider-off answers
- theme and language as radio groups, each theme with a preview of its colours, the choice remembered
- change password: 8 to 256 bytes checked before sending; a changed password signs this session out, as the server ends every session
- account name and role, and sign out
- greeting by the hour, recently played songs from the listening history (each song once), shelves of albums and artists
- an empty history, an empty library and a song that is gone each get their own short message
- a shelf that cannot be loaded does not hide the others
- search page with a 250 ms pause after typing, the text kept in the address, and at most 200 characters sent
- artists, albums and songs in three groups of six, each with a link to the full list
- accents and capitals are left to the server, which ignores them
- list hooks can take a smaller page size and stay switched off until there is something to ask
- lists of artists, albums and songs, loaded 50 at a time, with the search text taken from the address
- album page and artist page; a click on a song plays the list from there
- artist page shows a Wikipedia text, similar artists and tags with their credits, and the photo credit
- providers that are off, unreachable or without an id give a short explanation, never an error page
- artists a provider named, with nothing to play, still have a page
- Asking whether Lidarr has an artist keeps the answer for a minute, asks once however
many ask at once, and has at most four questions on their way; what cannot be
answered is not kept, and a send forgets what was kept.
- An id that is not a MusicBrainz id (one that a provider named and that was only
cleaned) is no id: it is refused or shown as no_id instead of becoming a 500.
- A send that waits for its turn gives up when its request does.
- A bad answer after the add also says the artist may have been added; a canceled
send ends like the other canceled requests.
- The README says which artists can be sent.
- bar at the bottom of every page with cover, artists, controls, seek and time
- full-screen player in a dialog: big cover, bar-style seek control, up next, focus kept inside, Escape closes
- Space plays and pauses unless the key belongs to a field, a button or a link
- songs list row, seek control and time formatting
- jumpTo in the queue store for a click on an upcoming track
- one event per play with its own idempotency key: complete, skip, or play when the page closes
- a failed send is retried with the same body and key after 1, 4 and 16 seconds; a 400 or 404 is final
- closing the page sends the open play and anything waiting for a retry with keepalive
- a hidden tab keeps playing, so only pagehide ends a play early
- POST /artists/{id}/lidarr (admin) adds the artist to the admin's own Lidarr by its
MusicBrainz id, never by name, with the profiles, the folder and the monitor
option the admin chose. It works for any artist that has an id, also one that
Sonda only learned of from a list of similar artists. It can be repeated: an artist
that Lidarr already has changes nothing. Two sends at once go one after the other.
- GET /artists/{id}/lidarr (signed in) says whether Lidarr has the artist and
monitors it; what stops the answer is a status (disabled, no_id, not_configured,
error), as for the descriptions.
- It needs the provider switched on and the profiles and folder chosen; a timeout
says the artist may have been added anyway.
- Spec, contract test and README, which also say that Sonda downloads nothing.
- drives the audio element from the player store: load, play, pause, seek, next on end
- a renewed access token swaps the stream URL and resumes at the same second, playing or paused
- reports start, listened time (in steps of at most two seconds) and finish for the listen reporter
- media keys and lock screen through the Media Session API
- queue with next, previous, seek, repeat (off, all, one), shuffle that keeps the original order, enqueue, play next and remove
- seek and restart requests are explicit, so the audio engine can follow them
- sidebar with the current page marked, privacy note, and a main area that wraps on narrow screens
- routes for home, search, artists, albums, songs and settings, and a not-found page
- paged lists for artists, albums and songs, 50 at a time, with search text and artist/album filters
- cover and artist photo that fall back to rings or an initial, and retry when the token is renewed
- fetch client with bearer token, one retry after a renewal, ApiError with the server code
- session kept in localStorage; renewal is single-flight in a tab and under a Web Lock across tabs, and a tab adopts a session another tab already renewed
- a refused refresh token signs out once; an unreachable server keeps the session
- mediaUrl and onTokenChange for audio and image URLs that carry the token
- sign-in and first-account screen, and a gate that shows the app only when signed in
- i18next with en and it, language from the stored choice, then the browser, then English
- a test keeps both files on the same keys with no empty text
- API error codes map to error.<code>, with error.unknown as the fallback
- Sonda, Tokyo Night, Gruvbox dark and Gruvbox light as CSS variables with shadcn token names
- contrast test: text 4.5:1, accent and form outlines 3:1 in every theme
- Gruvbox dark muted text lightened to pass
- theme choice is stored in localStorage and survives it being blocked
- Vite, React 19 and TypeScript in web/, Vitest with jsdom and Testing Library
- Tailwind v4 and shadcn/ui, with Figtree and Fraunces bundled locally
- npm run gen:api builds src/api/schema.d.ts from the OpenAPI spec
- dev server proxies /api to sondad (SONDA_URL, default 127.0.0.1:8080)
- mockFetch test helper that refuses unmatched requests
- Setting the address alone now stores the default options (monitor all, search
for missing albums), so what is shown is what will be sent.
- A 409 from Lidarr, when two adds of the same artist cross, means the artist is
already there; only "an artist with this ID was not found" is an unknown artist.
- The client never goes through a proxy named by the environment, since Lidarr is
on the admin's own network and the key travels in a header.
- An address that cannot be read back (an IPv6 zone) is refused instead of being
stored and reported as "not configured".
- A deadline asking Lidarr is a bad gateway, not an internal error; a redirect is
reported with a hint to use the final address; the request schema of the Lidarr
options is closed.
Lidarr is a server of the user's own that looks for and downloads music. Sonda
never downloads; this is the first piece of letting an admin send it an artist.
- The `lidarr` provider, off by default: an address, an API key (32 hexadecimal
characters, never returned) and, chosen once, a quality profile, a metadata
profile, a root folder, the monitor option and whether to search for missing
albums. It cannot be enabled without an address and a key.
- The address is checked: http or https, no user and password, no query, no
fragment, no closing slash.
- A small client of its own, apart from the outbound one (which only makes plain
GETs): the key travels in a header, no redirect is ever followed, answers and
time are bounded, and the address and key are read for every request.
Status, options, artist by MusicBrainz id and add (lookup, then the add that
Lidarr's own screen sends).
- `GET /providers/lidarr/options` lists the profiles and root folders; the test of
the provider checks the address and the key (`no_address` when it has none).
- Migration 0017 adds the address and the options to the provider settings.
- OpenAPI, contract test and README say what is sent and where.
- A search text that has nothing left once its accents are taken off matches
nothing instead of everything.
- The search key folds compatibility forms (the ligature "fi", full-width
letters) and the Greek final sigma.
- The start-up refresh of the keys logs when it starts and how long it took, since
it can take a while on a big library the first time.
- More tests: a retitled track is found by its new title, a refresh fixes both
keys and keeps "Beyoncé" and "Beyonce" apart, more cases for the key.
- A search key apart from the key that identifies artists, albums and tracks:
lower case, accents taken off (Latin, Greek and Cyrillic marks only, so kana
and Hangul stay intact), and letters like ß, æ, ø, ł written plain.
- GET /artists, /albums and /tracks look in it, so "bjork" finds "Björk" and
"strasse" finds "Straße".
- "Beyoncé" and "Beyonce" stay two artists: the identity key keeps accents.
- Migration 0016 adds the column on SQLite and PostgreSQL; RefreshMatchKeys
fills it for existing rows at start.
- golang.org/x/text is now a direct dependency.
- A panic while counting no longer leaves the job marked as running; a panic in the
work of one item is a failure of that item, and a panic in the list ends the job
with a reason.
- A stop while the items are counted is recorded as a stop instead of a 500, and a
count that fails leaves the status as the previous job left it.
- An artist that lost its MusicBrainz id since it was listed is skipped by the
pictures job, as the spec says, instead of counting as a failure.
- A picture that cannot be used now (refused download, bytes that are not an image)
is a failure when a good picture is stored, so a refresh never throws it away.
- The outcomes the artist jobs report share their constants in the jobs package.
- The spec no longer calls each job "the one request" that goes through the library.
- The test that waited with a sleep for the count now waits for a signal.
Add one engine, internal/jobs, that runs the jobs which go through the whole
library: start, stop, progress, one at a time, give up after five failures in
a row, end at once when a provider is off.
- The covers job now runs on the engine; its API is unchanged.
- POST/GET/DELETE /library/artist-images looks for the picture of every
artist of the library that has a MusicBrainz id.
- POST/GET/DELETE /library/descriptions does the same for the Wikipedia
description.
- ?refresh=true searches everything again and never replaces a stored result
by a failure; artists without an id are never touched, nothing is looked up
by name.
- images.Service.EnsureArtistImage and about.Service.Ensure do the work for one
artist; the lists come from ImageRepo and DiscoveryRepo.
- jobs.Runner binds a job to the application context, replacing the two
hand-written controls.
- OpenAPI, contract test and README describe the new endpoints and say that
they are bulk requests.
- A refresh (or any rebuild) while the Cover Art Archive is switched off, but its data
not taken back, no longer turns the covers it gave into "no cover" and deletes their
files: the stored cover is kept and its date renewed, so the files are not searched
again at every request.
- When none of an album's files and folders can be looked at (an unmounted disk, a
permission), that is ErrFilesUnreadable (503 files_unreadable), not "no picture": nothing
is remembered, nothing built is touched, the archive is not asked, and the job counts it
as a failure and gives up after five. A link that leaves the library is still just refused.
- The job calls the build for every album that is not good yet and does not serve an older
cover on an outage, so a dead provider shows as failures and trips the limit instead of
being reported as covers from the archive.
- Start marks the job as running before counting the albums and does not hold the lock
meanwhile; a stop that comes back as a plain driver error is not a failure; a job that
finished by itself is never marked stopped.
- Spec and README say so; the tests cover each case, including a list that fails midway.
- POST /library/covers (admin) starts, in the background and one at a time like a scan,
a job that builds the cover of every album that has something to play and no cover that
is still good; GET /library/covers shows the progress and how the last job ended;
DELETE /library/covers stops it. ?refresh=true searches every album again.
- For each album it does what opening its cover does: the user's own files first, then the
Cover Art Archive if the provider is on. It gives up, and says why, when the provider
fails for five albums in a row; an album that vanished is skipped, not a failure.
- This is the one request that goes through the whole library, and the README and the
provider text say so: with the archive on it sends the release group id of each album with
no picture in its files, one after the other, spaced out.
- NewRouter now refuses to build when a service was not wired, naming it, instead of
panicking at the first request (the wiring of this job in main had been missed, which no
test could see).
- The outbound spacing test measures where the request leaves the client, so a busy
machine cannot make it fail.
- Spec, contract and HTTP tests, README updated.
Closes#45
- The covers that come from the Cover Art Archive now live in a folder of their own
(images/album-remote). Taking the provider's data back deletes that folder, so nothing
from the archive is left whatever became of its records: a rescan makes a record stale
and a later search that finds nothing replaces it, and neither of those used to remove
the files. A cover that moves between the user's files and the archive, or goes away,
no longer leaves the old files behind.
- A redirect to a place that is not allowed is an outage (502, not remembered, an older
cover served), not "no cover" for a day for every album. A picture over the limit is
still "no cover".
- A track that moves to another album (a fixed title) leaves the first with no track: it
gives up its release group id, so the album the track went to can take it. An album
that has an id keeps it; an id another album owns is not given twice.
- Waiting for a local slot is no longer reported as the provider being unreachable, and a
build whose reads were purged three times is not served with files that were never written.
- README and spec no longer say covers never contact anybody.
- Tests: the new folder and the purge after a rescan, files left by a replaced cover, the
local wait, repeated purges, a refused redirect, the update path with a taken id and the
emptied album.
- The scan reads the MusicBrainz release group id of an album from the tags of its
files (MUSICBRAINZ_RELEASEGROUPID, a vorbis comment or an ID3 frame) and stores it in
albums.mbid: it is taken only when the file has an album and exactly one valid id, an
album keeps the one it has, and an id that another album owns is not given twice. A full
rescan reads it for music that was already indexed.
- New provider "coverartarchive" (off by default, no key, contact in the User-Agent). When
an album has no picture in the user's own files, which always come first, its cover is
asked from the archive by that id and never by a title: only the id leaves the server.
The same GET /albums/{id}/cover; the record keeps the source. An outage is a 502
provider_unavailable and is not remembered, and an older cover is served in its place.
- The archive answers with three redirects (coverartarchive.org, archive.org, a data node
whose name changes). The outbound client can now follow redirects, but only the ones the
caller allows, up to a limit; here that is https on archive.org and its subdomains.
- A purge counter now guards the covers too: a read that started before the provider's data
was taken back is not kept. Removing the provider's data forgets the covers that came from
it and deletes their files, and leaves the ones from the user's files.
- Spec, contract and HTTP tests, README updated; the facts of the real archive are written down.
Closes#43
- A timeout inside the provider (the outbound client's own deadline, which wraps
context.DeadlineExceeded) was mistaken for the caller leaving and came out as a 500, so
an older stored picture was not served. The decision now uses the caller's own context,
and a build that runs out of its two minutes is an outage (502) too.
- A purge of the Commons data could be undone by a read that was already running: the row
was deleted, so the generation guard started from zero, and the files were written after
the files were removed. Pictures are now kept only under a purge counter; BeginArtistPurge
is called before the purge and a read that started earlier starts again, or is refused if
the provider is off by then.
- A redirect or an oversized picture from the picture host is a fault of that picture (no
picture), not an outage, and the pictures are downloaded through a client of their own so
that one bad file cannot open the breaker of the API calls.
- The author drops the invisible characters that reorder or hide text. Artist pictures are
decoded only up to 4 million pixels.
- Tests: an outage that ends in a deadline, a build that times out, a purge during a read,
a redirect and a huge picture from the host, a separate download client.
- GET and HEAD /artists/{id}/image serve a free picture of an artist as a JPEG
(size=small 300 px or large 1000 px, token in the query allowed for an <img>), and
GET /artists/{id}/image/credit gives the author, the licence and the page of the file,
to be shown next to it.
- New provider "commons" (off by default, no key, contact in the User-Agent), which also
needs MusicBrainz on. The way to the picture uses ids only, never a name: the artist's
MusicBrainz id, the Wikidata item MusicBrainz links to it, the file Wikidata names for
it (P18), Commons for its licence, and a 960 px copy from a Wikimedia picture host.
- Only free licences: public domain, CC0, CC BY and CC BY-SA. Non-commercial,
no-derivatives, GFDL alone, fair use and unknown licences are refused, since a copy is
kept. The author is plain text, the licence address is kept only on creativecommons.org,
and the download only from https thumb.wikimedia.org or upload.wikimedia.org.
- Built on the first request, kept in the data folder: 30 days, or a week when there is no
free picture; an older copy is served when Commons cannot be reached; a failure is not
remembered. Credit changes change the ETag.
- Removing the provider's data forgets the records and deletes the files; a read that started
before it is not saved over it.
- images table gets the credit (migration 0015); the purge reports images.
- Spec, contract test, README updated; the facts of the real APIs are written down.
Closes#41
- A page that cannot be used (no text, an address off Wikipedia, a redirect that is
never followed) is now an answer: the chain goes on to the next language and the
outcome is stored. Before, it was a failure asked about again at every view, and
redirects counted against the provider's breaker.
- The chain also needs the MusicBrainz provider to be on, since the id goes to it
with its own contact: nothing is sent to MusicBrainz that the admin did not allow.
The disclosure in the provider settings, the spec and the README say so.
- A Wikidata item that was merged into another is understood through the target: the
entity's own id is returned, compared with the page's item and stored. Verified on
the real API.
- The title shown is the one Wikidata names (with spaces), control characters are
dropped from the text (PostgreSQL refuses NUL), the text is cut to at most 4000
characters with the mark included, and a stored description is reported disabled
when the provider is off.
- A read that started before the provider was switched off does not save its result.
- Tests: the real clients with a redirect and a page without text, merged items,
MusicBrainz off, switching off during a read.
- GET /artists/{id}/description shows what Wikipedia says about an artist: a short
text with its page, a link and the licence (CC BY-SA 4.0).
- New provider "wikipedia" (off by default, no key, contact in the User-Agent, which
Wikimedia requires). The way to the text is a chain of ids, never a name: the
artist's MusicBrainz id, the Wikidata item MusicBrainz links to it, the Wikipedia
page Wikidata names in the first configured language that has one. A page is used
only if it is an article about that same item.
- [wikipedia] languages in the config (one to five codes of two or three lower case
letters, checked before they are sent: an unknown site makes Wikidata answer with
every language).
- Stored 30 days (a day when there was nothing to find), served stale if Wikipedia
fails, removed with the provider's data (the purge now reports descriptions).
- MusicBrainz client: WikidataID. Wikipedia client for Wikidata and the summary,
which also reads Wikidata's errors that come with HTTP 200.
- artist_descriptions table (migration 0014, SQLite and PostgreSQL).
- Spec, contract test, README and example config updated.
Closes#39
- At most two covers are built at the same time: a page of albums asked for at once
could decode dozens of large pictures together.
- A change to an album's files marks its record stale and moves a generation instead
of deleting the row. A build that started before the change is not saved over it
and starts again, so a "no cover" found too early cannot win for a day.
- A cover that was found is checked again after a week, so a picture replaced in a
folder is noticed.
- For CD1/Disc 2 folders the picture in the folder above is used. Folder pictures
are read one at a time, and the pixel count is computed in 64 bits.
- Stored files are synced before they get their name, an empty one counts as
missing, and old temporary files from a crash are removed.
- Files without track or disc numbers sort the same on both databases.
- storage.data_dir defaults next to the SQLite database, so a service started from
another folder does not need a writable working directory.
- Tests: a listener who leaves, a change during a build, the build limit, a named
pipe, an embedded picture of a file outside the library that exists, builds that
really overlap.
- GET and HEAD /albums/{id}/cover serve a JPEG made from the picture embedded in
the album's files, or else a cover, folder, front, album or albumart image
(jpg, jpeg, png) in the album's folder. ?size=small (300 px) or large (1000 px).
The token can be in the query, so an <img> element can use it.
- Built the first time it is asked for, scaled, and kept in storage.data_dir
(SONDA_DATA_DIR, default "data"); an album with no cover is remembered for a day.
A new or changed file of the album, or a full rescan, clears the record.
- Nothing is sent anywhere. Pictures are untrusted: files are opened inside the
library only (links are not followed), over 20 MB or 16 million pixels are
ignored, and what is served is always a JPEG made here. Stored files are 0600.
- images table (migration 0013, SQLite and PostgreSQL).
- Spec, contract test, README and example config updated.
Closes#37
- Purging a provider removes only the artists that provider's lists named. A
purge of MusicBrainz, which names none, no longer deletes an artist only a
wish kept alive, nor the wish.
- A mark no longer makes an artist visible to everybody: GET /artists/{id} and
the similar lookups did, which showed what other users marked. Marking or
unmarking needs an artist the user can see or has marked themselves, with the
same answer for both.
- Deleting an account cleans up the discovered artists only its marks kept, in
the same transaction and under the artist lock.
- Tests: a purge of another provider, deleting an account, the scanner adopting
a marked artist, and what another user can see of a marked artist.