Re: Problems with small test program

Johannes Dewender <[email protected]>
Newsgroups gmane.comp.audio.musicbrainz.devel
Message-ID <[email protected]>
Am 24.05.2014 06:22, schrieb Sturm Mabie:
> Hi, I'm developing an application that uses libmusicbrainz5. As a
> small test, I wrote some small test code:
>
> https://gist.github.com/smabie/a1bea42d47fe840bc1da
>
> printf("%d\n", mb5_release_list_size(rl));
>
> prints 0 when the program is given an argv[1] of "The Shins".
>
> Shouldn't this print the number of releases by the shins?
>
> What am I doing wrong?

What your program is doing is this query:

http://musicbrainz.org/ws/2/artist?query=%22The%20Sins%22&limit=10

As you can check in the browser this does not actually include any 
release information. You use the query result to get the MBID of the 
artist and then do a lookup of artist by id:

http://musicbrainz.org/ws/2/artist/0756eaa9-38f9-4766-b4b3-925b0aa11e40?inc=releases
(see 
http://metabrainz.github.io/libmusicbrainz/5.0.1/mb5__c_8h.html#a9fafc66621c5f831fbd9c7aebb10e6ce 
for that)

(note the inc=releases, otherwise you still don't get releases)

See:
https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2

libmusicbrainz is quite shallow as a wrapper and doesn't do additional 
requests automatically. You have to do them manually and make sure the 
results actually do include the information you need.

You also might want "release groups" rather than "releases" first.
Different editions of the same release/album are grouped in a "release 
group".

--
JonnyJD
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.