- fix: on PostgreSQL a purge could delete a discovered artist while a scan was
adopting it. The scan then failed on the missing artist for the whole file,
and the two could also deadlock. Purge now takes the same artist lock as the
scanner and discovery before it removes anything. Saving a list or tags does
too, and an artist that is gone by then is reported as not found instead of a
foreign key error, so a user who opened an artist that was removed meanwhile
gets a 404
- fix: a discovered artist that was only the source of a list stayed forever and
kept the artists of its own list alive, so chains built up. Cleanup now removes
such an artist and then follows the chain until nothing more goes
- fix: in a full rescan a file that came back but could not be read stayed
marked missing. It is restored first, as in a normal scan, and read as well
- fix: ?full given twice is refused, so a typo cannot start a scan of another
kind
- fix: genre cleaning lives in one place, used by the reader and the store
- docs: the files genres count the tracks the artist is credited on, and the spec
says every files tag is a genre
- test: a purge colliding with a scan on both databases (it fails without the
lock), a chain of discovered artists, saving for an artist that is gone, a
file that returns unreadable during a full scan
- feat: DELETE /api/v1/providers/{name}/data (admin) removes everything a
provider gave: its lists of similar artists, its tags and the records of
when it was asked, then the artists that only that data named and that
nobody has files for. Last.fm's terms ask for this when an agreement ends.
The user's own artists, music, listens and settings stay, the provider is not
switched off, and a second call removes nothing
- feat: a discovered artist that no list names any more is removed when the
list that named it is replaced, together with its tags, so they do not pile
up. Real artists, and any artist that another list still names, are kept
- feat: the scan reads the GENRE tag of each file, offline (several genres
separated by ";", lower case, at most five per file), and
GET /artists/{id}/tags gets a third entry, files: the genres of the artist's
own playable tracks, each weighted by how many tracks have it. It asks nobody
and is always there
- feat: POST /library/scan and POST /libraries/{id}/scan take full=true to read
every file again, not only the new or changed ones, so MusicBrainz ids and
genres reach music that was indexed before. Files keep their identity, so
listening history is kept. Anything but true or false is a 400
- test: the plan of a full scan, the scanner and the manager; the purge on both
databases, checked by removing the rule that spares real artists; the
cleanup of replaced lists; genres per file and per artist
- docs: README, OpenAPI and the todo list updated
- feat: the scan summary has an unsupported counter for audio files in formats
Sonda cannot read yet (m4a, ogg, opus, wav, wma, ...); they are counted and
never opened, instead of disappearing without a trace. Video containers such
as .mpg are not counted
- feat: folders named .@__thumb, @Recycle, #recycle, @eaDir, $RECYCLE.BIN and
System Volume Information are skipped, matched by exact name ignoring case,
so a NAS recycle bin does not end up in the library; a library whose own
folder carries one of these names is still scanned, and files indexed before
from such a folder are flagged missing like any vanished file
- docs: the README lists the new counter and the skipped folders
- test: system folders at any depth, near-miss names, a library inside a
system-named folder, entries flagged missing, unsupported counting
Closes#14
- feat(storage): libraries table (name, path); audio_files points at a library
by id instead of repeating the root path; migration 0005 for both drivers
turns every existing root into a library and keeps file ids, tracks and the
missing flag
- feat(library): Libraries service validates names and paths: absolute, an
existing directory, never the filesystem root, never inside or around
another library (checked on real paths, so symlinks cannot hide an overlap)
- feat(api): admin-only GET/POST /libraries, PATCH/DELETE /libraries/{id} and
POST /libraries/{id}/scan; deleting a library drops its index entries and
keeps tracks and listening history
- feat(library): the scanner and the scan manager work on libraries; scanning
with no libraries answers 409 no_libraries
- feat(streaming): the library directory comes from the database instead of
a configured list of roots
- breaking(config): library.roots is removed; an old config fails with a hint
to use POST /api/v1/libraries
- test: CRUD and duplicates on both databases, path change keeps files,
upgrade of a database written before libraries existed
- feat(library): walk each root, plan the changes, read tags with N parallel
workers and write from a single goroutine
- feat(library): detect renames by size and mtime only when the match is
unambiguous; mark vanished files missing instead of deleting them
- fix-safe: an unreadable root, an unreadable subdirectory or an interrupted
scan never marks files as missing; symlinks are skipped
- feat(library): event hub that fans scan progress out to subscribers without
ever blocking the scan (ready for a websocket client)
- feat(library): TagLib (WASM, no CGO) reader for MP3 and FLAC tags and
audio properties, with title and artist fallbacks
- feat(storage): library repository for SQLite and PostgreSQL
- feat(api): POST/GET /api/v1/library/scan to start a scan and read its status
- feat(config): library.scan_workers