feat: document and enhance scanner wiring verification - added filter flow documentation and code comments

This commit is contained in:
2026-07-30 19:36:11 +03:00
parent 827b5405e5
commit c2f3258186
5 changed files with 49 additions and 10 deletions

View File

@@ -31,6 +31,9 @@ func ScanArtist(ctx context.Context, db *database.DB, artistID string, threshold
// Apply the artist's type toggles at read time so ignore_singles /
// ignore_compilations changes take effect immediately, without waiting for
// the MusicBrainz cache to expire and prune rows on the next re-sync.
// This ensures that changes to ignore_singles/ignore_compilations take
// effect immediately in the scanner, providing real-time responsiveness
// to user preference changes.
settings, err := database.GetArtistSettings(db, artistID)
if err != nil {
// If artist settings don't exist, use empty filter (no filtering)
@@ -57,6 +60,10 @@ func ScanArtist(ctx context.Context, db *database.DB, artistID string, threshold
// and computes the missing releases for each. Results are concatenated into a
// single slice across all artists.
//
// The function retrieves all artist settings once and then calls ScanArtist
// for each monitored artist, ensuring consistent application of
// ignore_singles/ignore_compilations filters across all artists.
//
// ctx.Err() is checked between artists; if cancellation occurs mid-iteration,
// scanning stops early and the accumulated results so far are returned along
// with the cancellation error. threshold follows the same contract as