/*!
 * FM4cast - FM4 chromecast receiver/sender
 * http://sehaas.github.io/fm4cast
 *
 * Copyright 2013 Sebastian Haas (sehaas@deebas.com)
 * Released under the MIT license
 *
 */

( function( $ ) {

	$.LastFMArtwork = function(element) {
		this.tag = (element instanceof $) ? element : $(element);
	};

	$.LastFMArtwork.prototype = {

		start : function() {
			$(document).on("currentsong", $.proxy(this.fetchArtwork, this));
		},

		fetchArtwork : function(event, artist, track) {
			var url = "http://ws.audioscrobbler.com/2.0/";

			$.ajax({
				"url" : url,
				"dataType" : "jsonp",
				"data" : {
					"method" : "track.getInfo",
					"format" : "json",
					"api_key" : fm4c.config.lastfm_apikey,
					"autocorrect" : 1,
					"artist" : artist,
					"track" : track,
				},
				"success" : $.proxy(this.renderArtwork, this),
			});
		},

		renderArtwork : function(data) {
			if (!data && data.track === "undefined") {
				console.log("Could not load artwork [{0}]: {1}".format(data.error, data.message));
				return;
			}

			if (data.track && data.track.album && data.track.album.image) {
				var artwork = $.grep(data.track.album.image, function(val, idx) {
					return val.size === "extralarge";
				})[0];
				if (artwork) {
					this.tag.css("background-image", "url('{0}')".format(artwork["#text"]));
				}
			}
		},

	};

}(jQuery));
@@ -618,18 +618,19 @@
  : %22
-track
+artist
 .get
-I
+i
 nfo%22
@@ -751,30 +751,8 @@
 st,%0A
-%09%09%09%09%09%22track%22 : track,%0A
 %09%09%09%09
@@ -874,21 +874,22 @@
 && data.
-track
+artist
  === %22un
@@ -1017,21 +1017,22 @@
 f (data.
-track
+artist
  && data
@@ -1036,39 +1036,14 @@
 ata.
-track.album && data.track.album
+artist
 .ima
@@ -1082,19 +1082,14 @@
 ata.
-track.album
+artist
 .ima

use artist.getinfo and artist-image instead of track info