feat: write unit tests for filtering logic

This commit is contained in:
2026-07-27 23:21:50 +03:00
parent 348d0648ba
commit 35b1f466ec
3 changed files with 236 additions and 0 deletions

View File

@@ -152,6 +152,15 @@ Based on the specification (docs/Specification.md), the application follows a mo
- Apply the specified fuzzy matching algorithm consistently
- Centralize shared logic: Place reusable filtering, validation, or utility functions in dedicated files (e.g., internal/musicbrainz/filter.go) and import them across packages to ensure consistent behavior across cache-hit, cache-miss, and real-time paths
### Execution Flow
The application follows a sequential data pipeline:
1. Sync artists from Navidrome (populate artist_settings)
2. Sync discographies from MusicBrainz (populate external_releases with filtering)
3. Sync albums from Navidrome (populate local_albums)
4. Scan for missing releases using fuzzy matching (produces MissingRelease results)
This flow is implemented in the `syncAndScan()` function in `cmd/naviwatcher/main.go`, which is called by the periodic sync loop and on startup.
## Configuration Reference
See docs/Specification.md Section 7 for full config.yaml structure including:
- Server settings (host, port, basic auth)