mirror of https://github.com/perkeep/perkeep.git
index: Index MusicBrainz album IDs from music files.
Index "MusicBrainz Album ID" ID3v2 frames as "musicbrainzalbumid" media tags to facilitate downloading cover art from coverartarchive.org. Change-Id: Ie81017dd6f76ec355ee0d1daedfb7180cb70ad59
This commit is contained in:
parent
81cfa6f39f
commit
aa391ecdd1
Binary file not shown.
|
@ -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"},
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"`
|
||||
|
|
Loading…
Reference in New Issue