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

Empty array returned from MusicBrainz query if JSON key "releases" is missing. #35

Open
SWalkerTTU opened this issue Jun 20, 2020 · 1 comment

Comments

@SWalkerTTU
Copy link

Performing this query:

http://musicbrainz.org/ws/2/discid/CPuVKAnEu8JT0qUWkzcdMV7wHXA-?inc=artists+labels+recordings+release-groups+artist-credits&fmt=json

with Google Chrome resulted in this:

{
"id":"CPuVKAnEu8JT0qUWkzcdMV7wHXA-",
"track-count":12,
"artist":"Sleeper",
"barcode":"0078221882422",
"tracks":[{"title":"Feeling Peaky","length":173293,"artist":null},{"length":269973,"title":"Sale of the Century","artist":null},{"artist":null,"title":"Dress Like Your Mother","length":153000},{"title":"Statuesque","length":203560,"artist":null},{"artist":null,"title":"Nice Guy Eddie","length":200600},{"artist":null,"title":"Stop Your Crying","length":215906},{"title":"Lie Detector","length":152093,"artist":null},{"artist":null,"length":221800,"title":"What Do I Do Now?"},{"title":"Shrinkwrapped","length":286440,"artist":null},{"artist":null,"title":"Good Luck Mr. Gorsky","length":245733},{"artist":null,"title":"Factor 41","length":177333},{"artist":null,"length":172933,"title":"Click...off...gone"}],
"disambiguation":"",
"title":"The it Girl"
}

As there is no "releases" key in this result, PerformMusicBrainzQuery returns an empty array. The lack of a "releases" key is likely due to changes on the MusicBrainz server.

@sbooth
Copy link
Owner

sbooth commented Sep 15, 2020

Apparently that entry is a CD stub, "an anonymously submitted track list that contains a disc ID, barcode, comment field, and basic metadata like a release title and track names."

There are two options I can see to handle this case:

  1. Add cdstubs=no to the query string to suppress cd stubs.
  2. Attempt to parse cd stub data in absence of a release.

The best option is probably 2 but I'll need to investigate whether creating a phony release with the cd stub data works with the current MB code.

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

No branches or pull requests

2 participants