feat(library): remove a track from the library without deleting the file

RemoveFromLibrary deletes the audio_files rows the way the scan's own
orphan cleanup does and records each path in excluded_paths. The
exclusion is not an enhancement: without it the next scan finds the
file, sees no row and imports it again, so the button undoes itself.

The soft scan compares files on disk against rows in the database, so
surveyAudioFiles and countAudioFiles both take the exclusion set —
otherwise an excluded path makes the two disagree forever and queues a
full scan on every launch. Deleting a row cascades to queue_tracks, so
the removal calls the same CompactQueue hook RemoveLibrary does.

Also lands the requested badge: library-status-indicator is a button
again where it can act, utils/library-status.ts states once what owning
and wanting mean, and the long-declared queued state finally has a
producer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDCbcCZQepnpSQYJ6SxxZm
This commit is contained in:
2026-08-14 13:12:01 -04:00
co-authored by Claude Opus 5
parent dcc40b1781
commit dc890d1fcc
48 changed files with 3450 additions and 103 deletions
+10 -9
View File
@@ -33,15 +33,16 @@ func DefaultBindings() map[string]string {
"app.selectAll": "Ctrl+A",
"app.shortcuts": "?",
// Panel-specific (track list). There is no `tracklist.delete`:
// it was bound to Delete and advertised in Settings as
// configurable while nothing listened for it, because "remove
// from library" does not exist and it is not clear what it would
// remove — the row (which the next scan puts back unless the path
// is also excluded) or the file (a delete-your-music button one
// keystroke from a focused row). Advertise it again when it does
// something.
"tracklist.play": "Enter",
// Panel-specific (track list). `tracklist.delete` spent six
// phases advertised in Settings with nothing on the other end of
// it, because "remove from library" did not exist and it was not
// clear what it would remove. It now removes the row and
// excludes the path from future scans, and leaves the file on
// disk — and the key only *opens the confirmation*, never
// performs the removal, which is the only version defensible one
// keystroke from a focused row.
"tracklist.play": "Enter",
"tracklist.delete": "Delete",
// Panel-specific (autotag review). These are the keys the
// autotag page used to bind on its own document listener, which