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

Open
yonlu wants to merge 1 commits from fix/247-cover-art-orphans into main
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
All checks were successful
CI / check (push) Skipped
Required
CI / e2e (push) Skipped
Required
CI / check (pull_request) Successful in 3m19s
Required
Details
CI / e2e (pull_request) Successful in 10m53s
Required
Details
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/247-cover-art-orphans:fix/247-cover-art-orphans
git checkout fix/247-cover-art-orphans
Sign in to join this conversation.