feat: add metadata validation and scan acceptance support

This commit is contained in:
2026-03-16 18:01:36 +08:00
parent aa82db6b15
commit 5b0de4f99d
51 changed files with 3493 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
Test audio fixture guidance
The current unit tests avoid committing real audio binaries and instead use `byte[]` plus a mocked `AudioTagExtractor`.
Recommended real-file fixtures if you later want integration tests:
1. `valid-square-cover.flac`
- Tags: `title`, `artist`, `album_artist`, `album`, `track=01/12`
- Embedded PNG cover `320x320`
- UTF-8 encoded text
2. `missing-cover.mp3`
- Same core tags as above
- No embedded artwork
- Expected validator result: `COVER_MISSING`
3. `bad-track.m4a`
- Track stored as `1` instead of `01/12`
- Expected validator result: `INVALID_FORMAT`
4. `garbled-title.ogg`
- Title intentionally stored with broken encoding bytes so it decodes to `Bad <20> Title`
- Expected reader encoding result: `UNKNOWN`
To generate those fixtures quickly, ffmpeg plus a tagging tool is enough:
```bash
ffmpeg -f lavfi -i sine=frequency=440:duration=1 -c:a flac valid.flac
```
Then embed tags and artwork with a dedicated tag editor, or continue mocking `AudioTagExtractor` in unit tests for faster coverage.