I'm trying to download metadata from MusicBrainz using a 3rd party java library: musicbrainzws2-java
I'm trying to retrieve the metadata of individual songs in a specified album. I've retrieved the MBID of the album, but when I try to search for the songs in the album I get no return.
Here is my code:
public static void main (String args []) throws MBWS2Exception {
String artistName = "Imagine Dragons";
String album_id = null;
Artist artist = new Artist();
artist.search(artistName);
List<ArtistResultWs2> results = artist.getFullSearchResultList();
ArtistWs2 song = results.get(0).getArtist();
artist = new Artist();
song = artist.lookUp(song);
List<ReleaseGroupWs2> rgl = artist.getFullReleaseGroupList();
for(int i =0; i<rgl.size(); i++){
System.out.println(rgl.get(i).getTitle());
if(rgl.get(i).getTitle().equals("Night Visions")){
album_id = rgl.get(i).getId();
}
}
System.out.println("Night visions ID: " + album_id);
Release release = new Release();
release.search(album_id);
List<ReleaseResultWs2> list = release.getFullSearchResultList();
for(int i =0; i<list.size(); i++)
System.out.println(list.get(i).getEntity());
Can someone give me some pointers. Thanks
Managed to retrieve information code is below:
}