Skip to content

Commit

Permalink
Fix musicbrainz genres fetching
Browse files Browse the repository at this point in the history
- genres are now called tags
- tags needs to be in "mb fetch includes"
- release-group has them
- release has them
- and recording as well but we don't use them
- not sure what this outdated check was doing
- see musicbrainz.VALID_INCLUDES for reference
  • Loading branch information
JOJ0 committed Jan 31, 2025
1 parent a1c0ebd commit f4d4148
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions beets/autotag/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ def get_message(self):
TRACK_INCLUDES = ["artists", "aliases", "isrcs"]
if "work-level-rels" in musicbrainzngs.VALID_INCLUDES["recording"]:
TRACK_INCLUDES += ["work-level-rels", "artist-rels"]
if "genres" in musicbrainzngs.VALID_INCLUDES["recording"]:
RELEASE_INCLUDES += ["genres"]
if "tags" in [
musicbrainzngs.VALID_INCLUDES["release"],
musicbrainzngs.VALID_INCLUDES["release-group"],
]:
RELEASE_INCLUDES += ["tags"]


def track_url(trackid: str) -> str:
Expand Down Expand Up @@ -607,8 +610,8 @@ def album_info(release: dict) -> beets.autotag.hooks.AlbumInfo:

if config["musicbrainz"]["genres"]:
sources = [
release["release-group"].get("genre-list", []),
release.get("genre-list", []),
release["release-group"].get("tag-list", []),
release.get("tag-list", []),
]
genres: Counter[str] = Counter()
for source in sources:
Expand Down

0 comments on commit f4d4148

Please sign in to comment.