Index: plugins/artdisplay/artdisplay/Makefile.am
===================================================================
--- plugins/artdisplay/artdisplay/Makefile.am	(revision 4844)
+++ plugins/artdisplay/artdisplay/Makefile.am	(working copy)
@@ -2,6 +2,7 @@
 
 plugindir = $(PLUGINDIR)/artdisplay
 plugin_PYTHON = 			\
+	MagnatuneCoverArtSearch.py	\
 	PodcastCoverArtSearch.py	\
 	AmazonCoverArtSearch.py		\
 	LocalCoverArtSearch.py		\
Index: plugins/artdisplay/artdisplay/CoverArtDatabase.py
===================================================================
--- plugins/artdisplay/artdisplay/CoverArtDatabase.py	(revision 4844)
+++ plugins/artdisplay/artdisplay/CoverArtDatabase.py	(working copy)
@@ -22,12 +22,13 @@
 import gtk
 import itertools
 
+from MagnatuneCoverArtSearch import MagnatuneCoverArtSearch
 from PodcastCoverArtSearch import PodcastCoverArtSearch
 from AmazonCoverArtSearch import AmazonCoverArtSearch
 from LocalCoverArtSearch import LocalCoverArtSearch
 
 ART_SEARCHES_LOCAL = [LocalCoverArtSearch]
-ART_SEARCHES_REMOTE = [PodcastCoverArtSearch, AmazonCoverArtSearch]
+ART_SEARCHES_REMOTE = [MagnatuneCoverArtSearch, PodcastCoverArtSearch, AmazonCoverArtSearch]
 ART_FOLDER = '~/.gnome2/rhythmbox/covers'
 ART_CACHE_EXTENSION = 'jpg'
 ART_CACHE_FORMAT = 'jpeg'
--- /dev/null	2007-02-11 09:59:15.000000000 -0500
+++ plugins/artdisplay/artdisplay/MagnatuneCoverArtSearch.py	2007-02-24 11:57:52.000000000 -0500
@@ -0,0 +1,53 @@
+# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- 
+#
+# Copyright (C) 2006 - Martin Szulecki -- PodcastCoverArtSearch.py
+# Copyright (C) 2007 - Edward Duffy
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
+
+import urllib
+import rhythmdb
+
+ALBUM_ART_URL = 'http://www.magnatune.com/music/%s/%s/cover.jpg'
+
+class MagnatuneCoverArtSearch (object):
+	def __init__ (self, loader):
+		self.searching = False
+		self.cancel = False
+		self.entry = None
+
+	def search (self, db, entry, on_search_completed_callback, *args):
+		self.searching = True
+		self.cancel = False
+		self.entry = entry
+		self.args = args
+
+		# Check if entry is a Magnatune song
+		if entry.get_entry_type() != db.entry_type_get_by_name("MagnatuneEntryType"):
+			on_search_completed_callback (self, self.entry, None, *self.args)
+			return
+
+		album = urllib.quote(db.entry_get(entry, rhythmdb.PROP_ALBUM))
+		artist = urllib.quote(db.entry_get(entry, rhythmdb.PROP_ARTIST))
+		image_url = ALBUM_ART_URL % (artist,album)
+		
+		on_search_completed_callback (self, self.entry, image_url, *self.args)
+
+	def search_next (self):
+		return False
+
+	def get_best_match_urls (self, search_results):
+		# Return image URL
+		return [search_results]
