feat: add SyncAll periodic sync pipeline and wire Navidrome client into App

This commit is contained in:
2026-07-19 22:22:46 +03:00
parent 40c4240693
commit dc4bdcdab0
9 changed files with 417 additions and 4 deletions

View File

@@ -95,10 +95,10 @@ name collisions.)
- [x] run tests - must pass before task 3
### Task 3: Periodic sync pipeline
- [ ] add `SyncAll(ctx, ndClient, mbClient, db, ttl)` orchestrator: for each monitored artist → ensure MBID (resolve + persist if missing) → `musicbrainz.SyncArtistDiscography` → `navidrome.SyncAlbums`
- [ ] wire `navidrome.NewClient` into `App`; add `ndClient` field
- [ ] write tests for `SyncAll` with stubbed clients + `:memory:` DB (new artist gets MBID, existing MBID reused, unmonitored skipped)
- [ ] run tests - must pass before task 4
- [x] add `SyncAll(ctx, ndClient, mbClient, db, ttl)` orchestrator: for each monitored artist → ensure MBID (resolve + persist if missing) → `musicbrainz.SyncArtistDiscography` → `navidrome.SyncAlbums`
- [x] wire `navidrome.NewClient` into `App`; add `ndClient` field
- [x] write tests for `SyncAll` with stubbed clients + `:memory:` DB (new artist gets MBID, existing MBID reused, unmonitored skipped)
- [x] run tests - must pass before task 4
### Task 4: Main loop wiring (sync → scan)
- [ ] replace compute-only `run()` with: one immediate sync+scan, then a ticker-driven periodic sync+scan goroutine; keep graceful shutdown via ctx