diff --git a/pkg/index/indextest/testdata/0s.mp3 b/pkg/index/indextest/testdata/0s.mp3 index 0fb9b070d..7e4a59ded 100644 Binary files a/pkg/index/indextest/testdata/0s.mp3 and b/pkg/index/indextest/testdata/0s.mp3 differ diff --git a/pkg/index/indextest/tests.go b/pkg/index/indextest/tests.go index 64ff74d8b..d727f74eb 100644 --- a/pkg/index/indextest/tests.go +++ b/pkg/index/indextest/tests.go @@ -406,6 +406,7 @@ func Index(t *testing.T, initIdx func() *index.Index) { {"artist", "Test Artist"}, {"album", "Test Album"}, {"genre", "(20)Alternative"}, + {"musicbrainzalbumid", "00000000-0000-0000-0000-000000000000"}, {"year", "1992"}, {"track", "1"}, {"disc", "2"}, diff --git a/pkg/index/receive.go b/pkg/index/receive.go index d7c73832c..151da3b9c 100644 --- a/pkg/index/receive.go +++ b/pkg/index/receive.go @@ -567,15 +567,16 @@ func indexMusic(r types.SizeReaderAt, wholeRef blob.Ref, mm *mutationMap) { // Note: if you add to this map, please update // pkg/search/query.go's MediaTagConstraint Tag docs. tags := map[string]string{ - "title": tag.Title(), - "artist": tag.Artist(), - "album": tag.Album(), - "genre": tag.Genre(), - "year": yearStr, - "track": trackStr, - "disc": discStr, - "mediaref": mediaRef.String(), - "durationms": durationStr, + "title": tag.Title(), + "artist": tag.Artist(), + "album": tag.Album(), + "genre": tag.Genre(), + "musicbrainzalbumid": tag.CustomFrames()["MusicBrainz Album Id"], + "year": yearStr, + "track": trackStr, + "disc": discStr, + "mediaref": mediaRef.String(), + "durationms": durationStr, } for tag, value := range tags { diff --git a/pkg/search/query.go b/pkg/search/query.go index 10bc57163..6aae336bf 100644 --- a/pkg/search/query.go +++ b/pkg/search/query.go @@ -333,7 +333,7 @@ type FileConstraint struct { type MediaTagConstraint struct { // Tag is the tag to match. - // For ID3, this includes: title, artist, album, genre, year, track, disc, mediaref, durationms. + // For ID3, this includes: title, artist, album, genre, musicbrainzalbumid, year, track, disc, mediaref, durationms. Tag string `json:"tag"` String *StringConstraint `json:"string,omitempty"`