From 1bde1787b910b917eb17e8beded4ef4f37663bf7 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 29 Apr 2026 17:57:42 -0400 Subject: [PATCH] feat(cmd): start Lidarr reconciler worker alongside HTTP server Co-Authored-By: Claude Sonnet 4.6 --- cmd/minstrel/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/minstrel/main.go b/cmd/minstrel/main.go index 9b000abe..e35670e8 100644 --- a/cmd/minstrel/main.go +++ b/cmd/minstrel/main.go @@ -15,6 +15,8 @@ import ( "git.fabledsword.com/bvandeusen/minstrel/internal/config" "git.fabledsword.com/bvandeusen/minstrel/internal/db" "git.fabledsword.com/bvandeusen/minstrel/internal/library" + "git.fabledsword.com/bvandeusen/minstrel/internal/lidarrconfig" + "git.fabledsword.com/bvandeusen/minstrel/internal/lidarrrequests" "git.fabledsword.com/bvandeusen/minstrel/internal/logging" "git.fabledsword.com/bvandeusen/minstrel/internal/scrobble" "git.fabledsword.com/bvandeusen/minstrel/internal/scrobble/listenbrainz" @@ -88,6 +90,13 @@ func run() error { similarityWorker := similarity.NewWorker(pool, listenbrainz.NewClient(), logger.With("component", "similarity")) go similarityWorker.Run(ctx) + // Start the Lidarr reconciler worker. Per spec §M5a, polls pending Lidarr + // import requests and reconciles them against the library. Short-circuits + // to no-op when lidarr_config.enabled = false. + lidarrCfg := lidarrconfig.New(pool) + lidarrReconciler := lidarrrequests.NewReconciler(pool, lidarrCfg, logger.With("component", "lidarr")) + go lidarrReconciler.Run(ctx) + srv := server.New(logger, pool, scanner, subsonic.Config{ AllowPlaintextPassword: cfg.Subsonic.AllowPlaintextPassword, }, cfg.Events, cfg.Recommendation)