fix: address code review findings

This commit is contained in:
2026-07-19 20:53:06 +03:00
parent da8b8aa944
commit 2468859435
9 changed files with 34 additions and 228 deletions

View File

@@ -846,7 +846,7 @@ func TestSyncArtistDiscography_CacheHit_IgnoreSecondaryCompilation(t *testing.T)
}
// Seed a cached release: primary "Album" + secondary "Compilation".
// cached_at is set far in the past so it is still within any TTL (TTL 0).
// cached_at is set to the recent past so it is well within the 24h TTL.
if err := database.SaveExternalRelease(db, &database.ExternalRelease{
RGID: "rg-comp",
ArtistID: artistID,
@@ -854,7 +854,7 @@ func TestSyncArtistDiscography_CacheHit_IgnoreSecondaryCompilation(t *testing.T)
Type: "Album",
SecondaryTypes: []string{"Compilation"},
IsIgnored: false,
CachedAt: time.Now().UTC(),
CachedAt: time.Now().UTC().Add(-time.Hour),
}); err != nil {
t.Fatalf("seed cached release: %v", err)
}
@@ -863,7 +863,7 @@ func TestSyncArtistDiscography_CacheHit_IgnoreSecondaryCompilation(t *testing.T)
client := newTestClient("http://unused.invalid")
ctx := context.Background()
releases, err := SyncArtistDiscography(ctx, client, db, artistID, "mbid-unused", 0)
releases, err := SyncArtistDiscography(ctx, client, db, artistID, "mbid-unused", 24*time.Hour)
if err != nil {
t.Fatalf("SyncArtistDiscography() error: %v", err)
}