Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix musicbrainz genres fetching #5609

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix musicbrainz genres fetching #5609

wants to merge 1 commit into from

Conversation

JOJ0
Copy link
Member

@JOJ0 JOJ0 commented Jan 31, 2025

  • 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, it looked at "recordings" in the valid list even though genre fetching is only included in the album_info code and not track_info 🤷
  • see musicbrainz.VALID_INCLUDES for reference

Description

Fixes #X.

(...)

To Do

  • Documentation. (If you've added a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • Tests. (Very much encouraged but not strictly required.)

- 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
Copy link

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@JOJ0 JOJ0 requested a review from snejus January 31, 2025 22:28
@JOJ0
Copy link
Member Author

JOJ0 commented Jan 31, 2025

While looking at #5606 I realized that genres fetching from musicbrainz is actually broken since.....I don't know :-/

if "genres" in musicbrainzngs.VALID_INCLUDES["recording"]:
RELEASE_INCLUDES += ["genres"]
if "tags" in [
musicbrainzngs.VALID_INCLUDES["release"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling this line doesn't behave as intended. Did you consider adding tests?

Copy link
Member Author

@JOJ0 JOJ0 Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope actually I didn't, just trying to quickly fix what was broken and on to more important things :-)

Actually I'm rather wondering why these kinds of checks are of any use here. What is there purpose? Why is it useful to check if something is valid if it is allowed to get silently broken anyway? Nobody will notice when this check is false and the outcome just is: "there are no genres for this album". No error no nothing. Useless in my opinion.

This is by the way the valid_includes constants dict:

https://github.com/alastair/python-musicbrainzngs/blob/1638c6271e0beb9560243c2123d354461ec9f842/musicbrainzngs/musicbrainz.py#L36-L84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants