fix: FLAC, Ogg and Opus tracks carry their MusicBrainz recording id from the tag: one reader in library gives the scanner, the backfills and the importer the same ids, and the next scan re-reads the library (#5637)
release / govulncheck (push) Successful in 20s
release / web (push) Successful in 1m30s
release / go (push) Successful in 1m50s
release / integration (push) Successful in 5m19s
release / android (push) Successful in 5m50s
release / Build signed APK (releases and dev) (push) Successful in 6m12s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 16s
release / Verify release artifacts (tag releases only) (push) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 15:55:25 -04:00
co-authored by Claude Opus 5.5
parent c1305a547d
commit 9e7d50b38e
5 changed files with 109 additions and 76 deletions
+9 -4
View File
@@ -64,7 +64,12 @@ var audioExtensions = map[string]bool{
// and MP4 (#2500). dhowden/tag kept only the last, and 3,658 of the
// operator's 4,092 FLACs declare more than one, so most of their genres
// were never stored.
const tagReadVersion int16 = 4
// 5: the recording id is read from FLAC, Ogg Vorbis and Opus (#5637). Picard
// calls it MUSICBRAINZ_TRACKID there and dhowden/tag files that under the
// release-track name, so every Vorbis-tagged track came in without its
// tag id and waited on an AcoustID lookup. A re-read stores the tag id,
// over a looked-up one (D4).
const tagReadVersion int16 = 5
type Stats struct {
Scanned int `json:"scanned"`
@@ -272,9 +277,9 @@ func (s *Scanner) scanFile(
if err != nil {
return pgtype.UUID{}, false, fmt.Errorf("tag read: %w", err)
}
albumMBID, artistMBID := extractMBIDs(meta)
recordingMBID := extractRecordingMBID(meta)
releaseGroupMBID := extractReleaseGroupMBID(meta)
ids := ReadTagMBIDs(meta)
albumMBID, artistMBID := ids.Release, ids.Artist
recordingMBID, releaseGroupMBID := ids.Recording, ids.ReleaseGroup
artistName := meta.Artist()
if artistName == "" {