Bug 60 - abcde-2.8.1: WebService::MusicBrainz-2.x changed its API
Summary: abcde-2.8.1: WebService::MusicBrainz-2.x changed its API
Alias: None
Product: abcde
Classification: Unclassified
Component: CD lookup (show other bugs)
Version: unspecified
Hardware: All All
: Normal normal
Assignee: Steve McIntyre
Depends on:
Reported: 2017-04-05 11:27 BST by Thomas Klausner
Modified: 2018-02-27 15:24 GMT (History)
4 users (show)

See Also:

Patch fixing the issue for review (6.49 KB, patch)
2017-12-22 02:54 GMT, Nicolas Guillaumin

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Klausner 2017-04-05 11:27:07 BST
abcde-musicbrainz-tool does not work against the latest version of WebService::MusicBrainz.
E.g. WebService::MusicBrainz::Release was removed completely.
Comment 1 Ben Woods 2017-10-31 15:31:13 GMT
+1 for this bug.

Running abcde with WebService::MusicBrainz version 1.0.2 results in the following output.

$ abcde
dasd: 1 12  150 174754
Can't locate WebService/MusicBrainz/Release.pm in @INC (you may need to install the WebService::MusicBrainz::Release module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.24 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.24/mach /usr/local/lib/perl5/5.24 .) at /usr/local/bin/abcde-musicbrainz-tool line 19.
BEGIN failed--compilation aborted at /usr/local/bin/abcde-musicbrainz-tool line 19.
Grabbing entire CD - tracks: 01 02 03 04 05 06 07 08 09 10 11 12
Can't locate WebService/MusicBrainz/Release.pm in @INC (you may need to install the WebService::MusicBrainz::Release module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.24 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.24/mach /usr/local/lib/perl5/5.24 .) at /usr/local/bin/abcde-musicbrainz-tool line 19.
BEGIN failed--compilation aborted at /usr/local/bin/abcde-musicbrainz-tool line 19.
Comment 2 Nicolas Guillaumin 2017-12-18 02:19:34 GMT
I started to have a look at this.

One issue is that v1+ of WebService::MusicBrainz does not support querying by discid, but I was able to add support for this.

The main difficulty though is that the new MusicBrainz API structures things in quite a different way, so I'm not sure there will be an easy way to have abcde-musicbrainz-tool output exactly the same format.

It's especially complicated to get the tracks lengths and names from a discid, because you get all the releases associated with the discid, and each release may have multiple media, each with multiple discs, which are not necessarily the discid you were looking for.

See for example this discid query: https://musicbrainz.org/ws/2/discid/bupdDGoNUhTykvJauS_JeY83yck-?inc=artists+recordings&fmt=json

To be able to collect all the track names and lengths for each release, I would have to walk through each media, then each disc of the media, and check its id to find the one I queried for originally.

Feedback / advice welcome, am I on the right track or is there an easier way to do this?

In any case, don't hold your breath, it's likely to be long-winded, but I should get there eventually! :)
Comment 3 Ben Woods 2017-12-18 08:04:45 GMT
Thanks for your efforts Nicolas!
Comment 4 Nicolas Guillaumin 2017-12-21 06:06:21 GMT
No worries :)

I think I'm done, subject to a change in WebService::MusicBrainz being merged (https://github.com/bfaist/webservice-musicbrainz/pull/5)

What's the best way to submit my changes here? A git patch? Or I can expose a git remote to pull from otherwise.
Comment 5 Andrew Strong 2017-12-21 11:18:14 GMT
musicbrainz support is really Steve's baby but I suspect a patch would be the best way to go..
Comment 6 Nicolas Guillaumin 2017-12-22 02:54:54 GMT
Created attachment 58 [details]
Patch fixing the issue for review

Please find a patch for review (generated with git format-patch). It needs an update to WebService::MusicBrainz as outlined above, but that doesn't prevent reviewing the code if you have any feedback.

Comment 7 Nicolas Guillaumin 2018-01-09 05:51:39 GMT
Hi, my update to WebService::MusicBrainz has been merged and v1.0.3 is now available: http://search.cpan.org/dist/WebService-MusicBrainz/

It supports the discid query needed by this patch, so this should now be good for review (and hopefully merging!).
Comment 8 Steve McIntyre 2018-02-26 20:04:32 GMT
Thanks, looking now!
Comment 9 Steve McIntyre 2018-02-26 21:06:49 GMT
Tweaked very slightly to match up with other changes in the perl script, then tested and pushed. All looks good here, thanks for your efforts!
Comment 10 Nicolas Guillaumin 2018-02-27 15:24:17 GMT
No worries, thanks!