package com.namelessdev.mpdroid.cover;

import de.umass.lastfm.Album;
import de.umass.lastfm.ImageSize;

public class LastFMCover implements ICoverRetriever {

	public String[] getCoverUrl(String artist, String album, String path, String filename) throws Exception {
		String key = "7fb78a81b20bee7cb6e8fad4cbcb3694";
		
		Album albumObj = Album.getInfo(artist, album, key);
		return new String[] { albumObj.getImageURL(ImageSize.MEGA) };
	}

	@Override
	public boolean isCoverLocal() {
		return false;
	}

	@Override
	public String getName() {
		return "LastFM";
	}
}

@@ -368,16 +368,67 @@
 , key);%0A
+%09%09if(albumObj == null) %7B%0A%09%09%09return null;%0A%09%09%7Delse%7B%0A%09
 %09%09return
@@ -483,16 +483,20 @@
 EGA) %7D;%0A
+%09%09%7D%0A
 %09%7D%0A%0A%09@Ov

fix exception caused by missing album info in LastFMCover