feat: Minstrel no longer talks to Lidarr: its connection, Delete via Lidarr and the unmonitor options are gone, and the track reports are plain quarantine (M502 #5525)
release / govulncheck (push) Successful in 15s
release / web (push) Failing after 17s
release / go (push) Successful in 1m13s
release / integration (push) Successful in 4m56s
release / android (push) Successful in 5m9s
release / Build signed APK (releases and dev) (push) Successful in 5m19s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

Migration 0091 drops lidarr_config and renames the quarantine tables, types,
indexes and the history column off the Lidarr name. The Integrations Lidarr
card, the Reports "Delete via Lidarr" action, the merge and remove-track
unmonitor options, the Lidarr audit actions and error codes go, on the
server, web and Android. The README describes acquisition as it is now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 13:48:20 -04:00
co-authored by Claude Opus 5.5
parent c54792c51e
commit 3a16732883
170 changed files with 994 additions and 6242 deletions
-39
View File
@@ -1,39 +0,0 @@
package tracks
import (
"testing"
"git.fabledsword.com/bvandeusen/minstrel/internal/library"
)
func mbids(track, album string) library.MergedCopy {
c := library.MergedCopy{}
if track != "" {
c.TrackMbid = &track
}
if album != "" {
c.AlbumMbid = &album
}
return c
}
// Unmonitoring a second file of the kept copy's own album track would stop
// Lidarr managing the kept file too; that case must be recognised.
func TestSameLidarrTrack(t *testing.T) {
for _, tc := range []struct {
name string
kept library.MergedCopy
removed library.MergedCopy
wantSame bool
}{
{"same recording on the same album", mbids("rec", "alb"), mbids("rec", "alb"), true},
{"same recording on a compilation", mbids("rec", "alb"), mbids("rec", "comp"), false},
{"different recordings on one album", mbids("rec", "alb"), mbids("rec-2", "alb"), false},
{"kept copy has no mbids", mbids("", ""), mbids("rec", "alb"), false},
{"removed copy has no album mbid", mbids("rec", "alb"), mbids("rec", ""), false},
} {
if got := sameLidarrTrack(tc.kept, tc.removed); got != tc.wantSame {
t.Errorf("%s: sameLidarrTrack = %v, want %v", tc.name, got, tc.wantSame)
}
}
}
+21 -134
View File
@@ -1,17 +1,7 @@
// Package tracks owns the track-level admin actions behind DELETE
// /api/admin/tracks/{id}. Today that's RemoveTrack: the destructive part goes
// through library.DeleteTrackFile — the one path that deletes a track file —
// and when the operator opts in via `unmonitor=true` the service also tells
// Lidarr to flip the track's monitored flag off so Lidarr doesn't search for a
// replacement.
//
// History: an earlier shape (commit 50a231f, since rewritten) routed
// Lidarr-managed tracks through lidarrquarantine.DeleteViaLidarr — but
// that primitive deletes the entire **album** in Lidarr (Lidarr is
// album-granular and has no per-track delete API), which would silently
// drop sibling tracks the operator didn't ask to remove. The current
// shape per spec revision 723eee9 is "always direct delete; opt-in
// Lidarr unmonitor for replacement-suppression."
// /api/admin/tracks/{id} and the duplicate merge. RemoveTrack's destructive
// part goes through library.DeleteTrackFile — the one path that deletes a
// track file.
//
// The web track-kebab entry that called this was removed in f7278f24; the
// endpoint was kept deliberately for a safer admin surface to rebind.
@@ -23,13 +13,11 @@ import (
"fmt"
"log/slog"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgtype"
"github.com/jackc/pgx/v5/pgxpool"
"git.fabledsword.com/bvandeusen/minstrel/internal/apierror"
"git.fabledsword.com/bvandeusen/minstrel/internal/audit"
"git.fabledsword.com/bvandeusen/minstrel/internal/db/dbq"
"git.fabledsword.com/bvandeusen/minstrel/internal/library"
syncpkg "git.fabledsword.com/bvandeusen/minstrel/internal/sync"
)
@@ -40,55 +28,35 @@ import (
// same pointer.
var ErrNotFound = apierror.ErrNotFound
// LidarrUnmonitorer is the subset of *lidarr.Client RemoveTrack uses.
// Defined as an interface so tests can stub without spinning up a Lidarr
// httptest server. UnmonitorTrack failures are non-fatal at the service
// layer — the file + DB are already gone — so any error returned here
// surfaces as a `lidarr_unmonitor_failed` flag in the response, not as
// a hard error.
type LidarrUnmonitorer interface {
UnmonitorTrack(ctx context.Context, trackMbid, albumMbid string) error
}
// Service owns RemoveTrack. lidarr may be nil — when it is, the
// unmonitor branch is skipped entirely (with `lidarrUnmonitorFailed`
// remaining false) regardless of the unmonitor query param. This is
// the right fallback when Lidarr isn't configured: file + DB delete
// still happen.
// Service owns RemoveTrack and MergeDuplicates.
type Service struct {
pool *pgxpool.Pool
logger *slog.Logger
lidarr LidarrUnmonitorer
dataDir string
}
// NewService constructs a Service. logger may be nil (defaults to
// slog.Default). lidarr may be nil to disable the unmonitor branch.
// dataDir is the on-disk root for cached artifacts; used to clean up
// artist-art on artist delete. Empty string disables the cleanup.
func NewService(pool *pgxpool.Pool, logger *slog.Logger, lidarr LidarrUnmonitorer, dataDir string) *Service {
// slog.Default). dataDir is the on-disk root for cached artifacts; used to
// clean up artist-art on artist delete. Empty string disables the cleanup.
func NewService(pool *pgxpool.Pool, logger *slog.Logger, dataDir string) *Service {
if logger == nil {
logger = slog.Default()
}
return &Service{pool: pool, logger: logger, lidarr: lidarr, dataDir: dataDir}
return &Service{pool: pool, logger: logger, dataDir: dataDir}
}
// RemoveTrack deletes the track's file and then its row, tidies away an album
// or artist the delete empties, and (when unmonitor is true and the track is
// Lidarr-managed) tells Lidarr to flip the track's monitored flag off so it
// won't search for a replacement.
// RemoveTrack deletes the track's file and then its row, and tidies away an
// album or artist the delete empties.
//
// Returns:
// - deletedAlbumID: non-nil when removing the track left the album
// empty and the album row was deleted.
// - deletedArtistID: non-nil when both album AND artist were left
// empty (only set if deletedAlbumID is also set).
// - lidarrUnmonitorFailed: true when the operator requested unmonitor
// and the Lidarr call failed; the file + DB delete still succeeded.
// - err: ErrNotFound, or a failure before anything was deleted. When the
// file cannot be removed it is a *library.FileRemoveError and NOTHING was
// deleted — see library.DeleteTrackFile for why that order is the contract
// (#3918). A failed Lidarr unmonitor is reflected in the bool, not here.
// (#3918).
//
// adminID is currently unused — the cascade audit-log line that would
// reference it isn't wired in this slice. It's threaded through the
@@ -97,92 +65,25 @@ func NewService(pool *pgxpool.Pool, logger *slog.Logger, lidarr LidarrUnmonitore
func (s *Service) RemoveTrack(
ctx context.Context,
trackID, adminID pgtype.UUID, //nolint:revive // adminID reserved for audit-log wiring in a follow-up
unmonitor bool,
) (deletedAlbumID *pgtype.UUID, deletedArtistID *pgtype.UUID, lidarrUnmonitorFailed bool, err error) {
q := dbq.New(s.pool)
track, err := q.GetTrackByID(ctx, trackID)
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return nil, nil, false, ErrNotFound
}
return nil, nil, false, fmt.Errorf("get track: %w", err)
}
// Capture the album's mbid *before* the delete. If removing this track
// empties the album, its row is gone afterwards and the unmonitor walk
// would have no album mbid to name.
var albumMbid string
if track.Mbid != nil && *track.Mbid != "" && unmonitor && s.lidarr != nil {
alb, alerr := q.GetAlbumByID(ctx, track.AlbumID)
if alerr == nil && alb.Mbid != nil {
albumMbid = *alb.Mbid
}
// Lookup failure is tolerated — handled below as
// "no albumMbid → can't unmonitor → flag failure."
}
) (deletedAlbumID *pgtype.UUID, deletedArtistID *pgtype.UUID, err error) {
deleted, err := library.DeleteTrackFile(ctx, s.pool, s.logger, s.dataDir, trackID)
if err != nil {
if errors.Is(err, library.ErrTrackNotFound) {
return nil, nil, false, ErrNotFound
return nil, nil, ErrNotFound
}
return nil, nil, false, fmt.Errorf("delete track: %w", err)
return nil, nil, fmt.Errorf("delete track: %w", err)
}
// Lidarr unmonitor — non-fatal. The destructive part is done; any
// failure here is informational so the operator can retry manually.
if unmonitor && track.Mbid != nil && *track.Mbid != "" && s.lidarr != nil {
if albumMbid == "" {
// Couldn't capture the album mbid (album row had nil mbid
// or was missing somehow). The Lidarr walk needs it; mark
// failure rather than calling with an empty string.
s.logger.Warn("track delete: lidarr unmonitor skipped — no album mbid",
"track_id", trackID, "track_mbid", *track.Mbid)
lidarrUnmonitorFailed = true
} else if uerr := s.lidarr.UnmonitorTrack(ctx, *track.Mbid, albumMbid); uerr != nil {
s.logger.Warn("track delete: lidarr unmonitor failed",
"track_id", trackID, "track_mbid", *track.Mbid, "err", uerr)
lidarrUnmonitorFailed = true
}
}
return deleted.AlbumID, deleted.ArtistID, lidarrUnmonitorFailed, nil
return deleted.AlbumID, deleted.ArtistID, nil
}
// MergeDuplicates merges a duplicate group into the copy to keep
// (library.MergeDuplicateGroup), then — when asked — tells Lidarr to stop
// monitoring the removed copies so it does not download them again, and records
// the merge in the audit log.
//
// lidarrUnmonitorFailed reports that unmonitoring was asked for and at least one
// removed copy could not be unmonitored. Like RemoveTrack, that never fails the
// merge: the files and rows are already gone.
// (library.MergeDuplicateGroup) and records the merge in the audit log.
func (s *Service) MergeDuplicates(
ctx context.Context, groupID, survivorID, actorID pgtype.UUID, unmonitor bool,
) (res library.MergeResult, lidarrUnmonitorFailed bool, err error) {
res, err = library.MergeDuplicateGroup(ctx, s.pool, s.logger, s.dataDir, groupID, survivorID)
ctx context.Context, groupID, survivorID, actorID pgtype.UUID,
) (library.MergeResult, error) {
res, err := library.MergeDuplicateGroup(ctx, s.pool, s.logger, s.dataDir, groupID, survivorID)
if err != nil {
return res, false, err
}
if unmonitor && s.lidarr != nil {
for _, removed := range res.Removed {
if sameLidarrTrack(res.Survivor, removed) {
continue
}
if !hasLidarrIdentity(removed) {
s.logger.Warn("duplicate merge: lidarr unmonitor skipped — removed copy has no mbids",
"track_id", syncpkg.FormatUUID(removed.TrackID))
lidarrUnmonitorFailed = true
continue
}
if uerr := s.lidarr.UnmonitorTrack(ctx, *removed.TrackMbid, *removed.AlbumMbid); uerr != nil {
s.logger.Warn("duplicate merge: lidarr unmonitor failed",
"track_id", syncpkg.FormatUUID(removed.TrackID), "err", uerr)
lidarrUnmonitorFailed = true
}
}
return res, err
}
removed := make([]map[string]string, 0, len(res.Removed))
@@ -200,19 +101,5 @@ func (s *Service) MergeDuplicates(
"likes": res.Likes, "playlist_entries": res.PlaylistEntries,
},
})
return res, lidarrUnmonitorFailed, nil
}
// sameLidarrTrack reports whether two copies are the same Lidarr track: one
// recording on one album. Lidarr monitors per album track, so when the removed
// copy is a second file of the kept copy's own album track — the #3885 case —
// unmonitoring it would also stop Lidarr managing the file the operator chose to
// keep. Those are skipped, and are not a failure.
func sameLidarrTrack(a, b library.MergedCopy) bool {
return hasLidarrIdentity(a) && hasLidarrIdentity(b) &&
*a.TrackMbid == *b.TrackMbid && *a.AlbumMbid == *b.AlbumMbid
}
func hasLidarrIdentity(c library.MergedCopy) bool {
return c.TrackMbid != nil && *c.TrackMbid != "" && c.AlbumMbid != nil && *c.AlbumMbid != ""
return res, nil
}
+11 -207
View File
@@ -17,7 +17,7 @@ import (
"git.fabledsword.com/bvandeusen/minstrel/internal/dbtest"
)
// --- test seed helpers (inlined; mirrors lidarrquarantine patterns) -----
// --- test seed helpers (inlined; mirrors quarantine patterns) -----------
func newPool(t *testing.T) *pgxpool.Pool {
t.Helper()
@@ -95,23 +95,6 @@ func seedArtistAlbumTrack(t *testing.T, pool *pgxpool.Pool, prefix, mbid, filePa
return artist, album, track
}
// --- fake LidarrUnmonitorer --------------------------------------------
// fakeLidarrUnmonitorer captures call args + a configurable error so
// tests can assert "called with mbid X" and "RemoveTrack tolerated this
// Lidarr error."
type fakeLidarrUnmonitorer struct {
calls []string // captured trackMbid per call
albumMbid string // last albumMbid received
err error
}
func (f *fakeLidarrUnmonitorer) UnmonitorTrack(_ context.Context, trackMbid, albumMbid string) error {
f.calls = append(f.calls, trackMbid)
f.albumMbid = albumMbid
return f.err
}
// --- tests --------------------------------------------------------------
func TestRemoveTrack_NotFound(t *testing.T) {
@@ -122,8 +105,8 @@ func TestRemoveTrack_NotFound(t *testing.T) {
bogus.Bytes = [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}
bogus.Valid = true
svc := NewService(pool, nil, nil, "")
_, _, _, err := svc.RemoveTrack(context.Background(), bogus, admin.ID, false)
svc := NewService(pool, nil, "")
_, _, err := svc.RemoveTrack(context.Background(), bogus, admin.ID)
if !errors.Is(err, ErrNotFound) {
t.Errorf("err = %v, want ErrNotFound", err)
}
@@ -138,18 +121,13 @@ func TestRemoveTrack_LocalFile_HappyPath(t *testing.T) {
if err := os.WriteFile(path, []byte("x"), 0o644); err != nil {
t.Fatal(err)
}
// mbid empty → no Lidarr branch even with unmonitor=true.
_, _, track := seedArtistAlbumTrack(t, pool, "Solo", "", path)
fake := &fakeLidarrUnmonitorer{}
svc := NewService(pool, nil, fake, "")
_, _, lidarrFailed, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID, false)
svc := NewService(pool, nil, "")
_, _, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID)
if err != nil {
t.Fatalf("RemoveTrack: %v", err)
}
if lidarrFailed {
t.Error("lidarrUnmonitorFailed = true; want false on local-file happy path")
}
if _, err := os.Stat(path); !errors.Is(err, os.ErrNotExist) {
t.Errorf("file still present: %v", err)
}
@@ -157,9 +135,6 @@ func TestRemoveTrack_LocalFile_HappyPath(t *testing.T) {
if _, err := q.GetTrackByID(context.Background(), track.ID); err == nil {
t.Errorf("track row still exists")
}
if len(fake.calls) != 0 {
t.Errorf("Lidarr called %d times; want 0 (no mbid, unmonitor=false)", len(fake.calls))
}
}
func TestRemoveTrack_FileAlreadyMissing(t *testing.T) {
@@ -170,8 +145,8 @@ func TestRemoveTrack_FileAlreadyMissing(t *testing.T) {
missing := filepath.Join(t.TempDir(), "does-not-exist.mp3")
_, _, track := seedArtistAlbumTrack(t, pool, "Ghost", "", missing)
svc := NewService(pool, nil, nil, "")
_, _, _, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID, false)
svc := NewService(pool, nil, "")
_, _, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID)
if err != nil {
t.Fatalf("RemoveTrack: %v", err)
}
@@ -226,8 +201,8 @@ func TestRemoveTrack_Cascade_AlbumEmpty(t *testing.T) {
t.Fatalf("trackB: %v", err)
}
svc := NewService(pool, nil, nil, "")
delAlbum, delArtist, _, err := svc.RemoveTrack(context.Background(), trackA.ID, admin.ID, false)
svc := NewService(pool, nil, "")
delAlbum, delArtist, err := svc.RemoveTrack(context.Background(), trackA.ID, admin.ID)
if err != nil {
t.Fatalf("RemoveTrack: %v", err)
}
@@ -259,8 +234,8 @@ func TestRemoveTrack_Cascade_ArtistEmpty(t *testing.T) {
}
artist, album, track := seedArtistAlbumTrack(t, pool, "Lone", "", path)
svc := NewService(pool, nil, nil, "")
delAlbum, delArtist, _, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID, false)
svc := NewService(pool, nil, "")
delAlbum, delArtist, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID)
if err != nil {
t.Fatalf("RemoveTrack: %v", err)
}
@@ -278,174 +253,3 @@ func TestRemoveTrack_Cascade_ArtistEmpty(t *testing.T) {
t.Errorf("artist still exists after cascade")
}
}
// unmonitor=true AND mbid set → Lidarr called once; lidarrUnmonitorFailed=false.
// Uses two albums on the same artist so the album's row survives the
// cascade — that lets us assert the album mbid (captured pre-tx) is
// passed through correctly.
func TestRemoveTrack_Unmonitor_HappyPath(t *testing.T) {
pool := newPool(t)
admin := seedAdmin(t, pool, "alice")
q := dbq.New(pool)
artist, err := q.UpsertArtist(context.Background(), dbq.UpsertArtistParams{
Name: "Lidarr Artist", SortName: "Lidarr Artist",
})
if err != nil {
t.Fatalf("artist: %v", err)
}
albumMbid := "album-mbid-xyz"
album, err := q.UpsertAlbum(context.Background(), dbq.UpsertAlbumParams{
Title: "Lidarr Album", SortTitle: "Lidarr Album",
ArtistID: artist.ID, Mbid: &albumMbid,
})
if err != nil {
t.Fatalf("album: %v", err)
}
dir := t.TempDir()
pathA := filepath.Join(dir, "a.mp3")
pathB := filepath.Join(dir, "b.mp3")
_ = os.WriteFile(pathA, []byte("x"), 0o644)
_ = os.WriteFile(pathB, []byte("x"), 0o644)
trackMbid := "track-mbid-abc"
track, err := q.UpsertTrack(context.Background(), dbq.UpsertTrackParams{
Title: "T1", AlbumID: album.ID, ArtistID: artist.ID,
DurationMs: 1000, FilePath: pathA, FileSize: 1, FileFormat: "mp3",
Mbid: &trackMbid,
})
if err != nil {
t.Fatalf("track1: %v", err)
}
// Sibling track keeps the album alive after the delete.
if _, err := q.UpsertTrack(context.Background(), dbq.UpsertTrackParams{
Title: "T2", AlbumID: album.ID, ArtistID: artist.ID,
DurationMs: 1000, FilePath: pathB, FileSize: 1, FileFormat: "mp3",
}); err != nil {
t.Fatalf("track2: %v", err)
}
fake := &fakeLidarrUnmonitorer{}
svc := NewService(pool, nil, fake, "")
_, _, lidarrFailed, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID, true)
if err != nil {
t.Fatalf("RemoveTrack: %v", err)
}
if lidarrFailed {
t.Error("lidarrUnmonitorFailed = true; want false on happy path")
}
if len(fake.calls) != 1 {
t.Fatalf("Lidarr call count = %d, want 1", len(fake.calls))
}
if fake.calls[0] != trackMbid {
t.Errorf("Lidarr called with mbid %q, want %q", fake.calls[0], trackMbid)
}
if fake.albumMbid != albumMbid {
t.Errorf("Lidarr called with albumMbid %q, want %q", fake.albumMbid, albumMbid)
}
}
// unmonitor=true AND Lidarr fails → file + DB still deleted, flag set,
// service returns nil error.
func TestRemoveTrack_Unmonitor_LidarrErrorIsNonFatal(t *testing.T) {
pool := newPool(t)
admin := seedAdmin(t, pool, "alice")
q := dbq.New(pool)
artist, err := q.UpsertArtist(context.Background(), dbq.UpsertArtistParams{
Name: "ErrFatal Artist", SortName: "ErrFatal Artist",
})
if err != nil {
t.Fatalf("artist: %v", err)
}
albumMbid := "err-album-mbid"
album, err := q.UpsertAlbum(context.Background(), dbq.UpsertAlbumParams{
Title: "ErrFatal Album", SortTitle: "ErrFatal Album",
ArtistID: artist.ID, Mbid: &albumMbid,
})
if err != nil {
t.Fatalf("album: %v", err)
}
dir := t.TempDir()
path := filepath.Join(dir, "f.mp3")
if err := os.WriteFile(path, []byte("x"), 0o644); err != nil {
t.Fatal(err)
}
trackMbid := "err-track-mbid"
track, err := q.UpsertTrack(context.Background(), dbq.UpsertTrackParams{
Title: "T", AlbumID: album.ID, ArtistID: artist.ID,
DurationMs: 1000, FilePath: path, FileSize: 1, FileFormat: "mp3",
Mbid: &trackMbid,
})
if err != nil {
t.Fatalf("track: %v", err)
}
fake := &fakeLidarrUnmonitorer{err: errors.New("simulated lidarr 5xx")}
svc := NewService(pool, nil, fake, "")
_, _, lidarrFailed, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID, true)
if err != nil {
t.Fatalf("RemoveTrack: %v (want nil — Lidarr failure is non-fatal)", err)
}
if !lidarrFailed {
t.Error("lidarrUnmonitorFailed = false; want true after Lidarr error")
}
// File + DB still gone.
if _, err := os.Stat(path); !errors.Is(err, os.ErrNotExist) {
t.Errorf("file still present after Lidarr error: %v", err)
}
if _, err := q.GetTrackByID(context.Background(), track.ID); err == nil {
t.Errorf("track row still present after Lidarr error")
}
}
// unmonitor=true AND mbid empty (non-Lidarr track) → no Lidarr call.
func TestRemoveTrack_Unmonitor_NoMbidSkipsLidarr(t *testing.T) {
pool := newPool(t)
admin := seedAdmin(t, pool, "alice")
dir := t.TempDir()
path := filepath.Join(dir, "local.mp3")
if err := os.WriteFile(path, []byte("x"), 0o644); err != nil {
t.Fatal(err)
}
_, _, track := seedArtistAlbumTrack(t, pool, "Local", "", path)
fake := &fakeLidarrUnmonitorer{}
svc := NewService(pool, nil, fake, "")
_, _, lidarrFailed, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID, true)
if err != nil {
t.Fatalf("RemoveTrack: %v", err)
}
if lidarrFailed {
t.Error("lidarrUnmonitorFailed = true; want false (no mbid)")
}
if len(fake.calls) != 0 {
t.Errorf("Lidarr call count = %d, want 0 (track has no mbid)", len(fake.calls))
}
}
// unmonitor=false AND mbid set → no Lidarr call.
func TestRemoveTrack_NoUnmonitor_SkipsLidarr(t *testing.T) {
pool := newPool(t)
admin := seedAdmin(t, pool, "alice")
dir := t.TempDir()
path := filepath.Join(dir, "lidarr.mp3")
if err := os.WriteFile(path, []byte("x"), 0o644); err != nil {
t.Fatal(err)
}
_, _, track := seedArtistAlbumTrack(t, pool, "NoMon", "track-mbid", path)
fake := &fakeLidarrUnmonitorer{}
svc := NewService(pool, nil, fake, "")
_, _, lidarrFailed, err := svc.RemoveTrack(context.Background(), track.ID, admin.ID, false)
if err != nil {
t.Fatalf("RemoveTrack: %v", err)
}
if lidarrFailed {
t.Error("lidarrUnmonitorFailed = true; want false (unmonitor=false)")
}
if len(fake.calls) != 0 {
t.Errorf("Lidarr call count = %d, want 0 (unmonitor=false)", len(fake.calls))
}
}