fix: address code review findings
This commit is contained in:
@@ -139,6 +139,35 @@ func TestScanArtist_RemasteredVariantNotMissing(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestScanArtist_YearTitledAlbumReissueReportedMissing(t *testing.T) {
|
||||
db := newTestDB(t)
|
||||
defer db.Close()
|
||||
|
||||
// Rush "2112" is a bare year-titled album; "2112 (Remastered)" is a
|
||||
// distinct release group. Owning the standard 2112 must NOT count as owning
|
||||
// the remastered reissue — the reissue should be reported missing.
|
||||
seedArtist(t, db, "artist-1", "Rush")
|
||||
seedLocalAlbum(t, db, "l1", "artist-1", "2112")
|
||||
seedExternalRelease(t, db, "rg-standard", "artist-1", "2112", false)
|
||||
seedExternalRelease(t, db, "rg-remaster", "artist-1", "2112 (Remastered)", false)
|
||||
|
||||
missing, err := ScanArtist(context.Background(), db, "artist-1", 0)
|
||||
if err != nil {
|
||||
t.Fatalf("ScanArtist() error: %v", err)
|
||||
}
|
||||
|
||||
rgids := map[string]bool{}
|
||||
for _, m := range missing {
|
||||
rgids[m.RGID] = true
|
||||
}
|
||||
if rgids["rg-standard"] {
|
||||
t.Errorf("standard 2112 should match local copy, not be missing")
|
||||
}
|
||||
if !rgids["rg-remaster"] {
|
||||
t.Errorf("2112 (Remastered) reissue should be reported missing, got %v", rgids)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScanArtist_CtxCancelled(t *testing.T) {
|
||||
db := newTestDB(t)
|
||||
defer db.Close()
|
||||
|
||||
Reference in New Issue
Block a user