fix(library): sweep orphaned cover art when an album empties #251

Merged
yonlu merged 2 commits from fix/247-cover-art-orphans into main 2026-09-21 01:14:58 +00:00
Owner
commit issue
32bb6491 fix(library): sweep orphaned cover art when an album empties #247

Verification

  • go test ./backend/library/...
  • golangci-lint run .

pruneEmptyEntities deleted empty albums but never the cover_art rows
they referenced, so removing the last track of an album leaked the row
and its files forever (the janitor's covers sweep computes its live set
from cover_art.file_path, keeping the orphaned row's files exempt).
Extracts one sweep used by the scan path, RemoveFromLibrary and
RemoveLibrary.

Closes #247

| commit | issue | |---|---| | `32bb6491` fix(library): sweep orphaned cover art when an album empties | #247 | ## Verification - `go test ./backend/library/...` - `golangci-lint run .` `pruneEmptyEntities` deleted empty albums but never the `cover_art` rows they referenced, so removing the last track of an album leaked the row and its files forever (the janitor's covers sweep computes its live set from `cover_art.file_path`, keeping the orphaned row's files exempt). Extracts one sweep used by the scan path, `RemoveFromLibrary` and `RemoveLibrary`. Closes #247
yonlu added 1 commit 2026-09-09 14:23:35 +00:00
fix(library): sweep orphaned cover art when an album empties
CI / check (push) Skipped
CI / e2e (push) Skipped
CI / check (pull_request) Successful in 3m19s
CI / e2e (pull_request) Successful in 10m53s
32bb64918c
pruneEmptyEntities deleted empty albums but never the cover_art rows
they referenced, so removing the last track of an album leaked the row
and its files forever — the janitor's covers sweep computes its live set
from cover_art.file_path, which keeps the orphaned row's files exempt.

Extract sweepOrphanedCoverArt/removeCoverArtFiles as one implementation
and run it from pruneEmptyEntities (scan orphan path and
RemoveFromLibrary) and RemoveLibrary alike.

Closes #247
yonlu added 1 commit 2026-09-21 00:59:24 +00:00
Merge remote-tracking branch 'origin/main' into fix/247-cover-art-orphans
CI / check (push) Skipped
CI / e2e (push) Skipped
CI / check (pull_request) Successful in 3m35s
CI / e2e (pull_request) Successful in 11m41s
53f480980f
yonlu merged commit 8db19622b2 into main 2026-09-21 01:14:58 +00:00
Sign in to join this conversation.