diff -ur /home/adam/rhythmbox/plugins/magnatune/magnatune/__init__.py ./magnatune/__init__.py
--- /home/adam/rhythmbox/plugins/magnatune/magnatune/__init__.py	2006-07-07 09:44:13.000000000 +0300
+++ ./magnatune/__init__.py	2006-07-07 00:04:38.000000000 +0300
@@ -39,8 +39,8 @@
 		'ccnumber': "/apps/rhythmbox/plugins/magnatune/cc_number",
 		'ccyear': "/apps/rhythmbox/plugins/magnatune/cc_year",
 		'ccmonth': "/apps/rhythmbox/plugins/magnatune/cc_month",
-		'ccname': "/apps/rhythmbox/plugins/magnatune/name_month",
-		'email': "/apps/rhythmbox/plugins/magnatune/email_month"
+		'ccname': "/apps/rhythmbox/plugins/magnatune/name",
+		'email': "/apps/rhythmbox/plugins/magnatune/email"
 	}
 
 
@@ -112,6 +112,15 @@
 			# FIXME this bit should be in glade too
 			dialog = gladexml.get_widget('preferences_dialog')
 			dialog.connect("response", lambda w, r: w.hide())
+			
+			if self.client.get_string(self.gconf_keys['ccname']) == None: # check to make sure fields exist
+				self.client.set_string(self.gconf_keys['ccname'], "")
+				self.client.set_string(self.gconf_keys['email'], "")
+				self.client.set_string(self.gconf_keys['ccnumber'], "")
+				self.client.set_string(self.gconf_keys['ccyear'], "")
+				self.client.set_string(self.gconf_keys['ccmonth'], "")
+				self.client.set_int(self.gconf_keys['pay'], 3)
+				self.client.set_string(self.gconf_keys['format'], "")
 
 			gladexml.get_widget("name_entry").set_text(self.client.get_string(self.gconf_keys['ccname']))
 			gladexml.get_widget("email_entry").set_text(self.client.get_string(self.gconf_keys['email']))
diff -ur /home/adam/rhythmbox/plugins/magnatune/magnatune/MagnatuneSource.py ./magnatune/MagnatuneSource.py
--- /home/adam/rhythmbox/plugins/magnatune/magnatune/MagnatuneSource.py	2006-07-07 09:44:13.000000000 +0300
+++ ./magnatune/MagnatuneSource.py	2006-07-07 07:25:30.000000000 +0300
@@ -1,11 +1,12 @@
 import rb, rhythmdb
 from TrackListHandler import TrackListHandler
-from BuyAlbumHandler import BuyAlbumHandler
+from BuyAlbumHandler import BuyAlbumHandler, MagnatunePurchaseError
 
 import gobject
 import gtk.glade
 import gnomevfs, gnome, gconf
 import xml
+import urllib, zipfile
 
 magnatune_partner_id = "zimmerman"
 
@@ -66,7 +67,7 @@
 				progress = min (float(self.__load_current_size) / self.__load_total_size, 1.0)
 			else:
 				progress = 0.0
-			return (_("Loading MagnaTune catalogue"), None, progress)
+			return (_("Loading Magnatune catalogue"), None, progress)
 		else:
 			# FIXME: how do you actually do this?
 			#return rb.BrowserSource.do_impl_get_status (self)
@@ -78,7 +79,7 @@
 			self.__db = shell.get_property('db')
 			self.__entry_type = self.get_property('entry-type')
 
-			self.__activate = True
+			self.__activated = True
 			self.__show_loading_screen (True)
 			self.__load_catalogue()
 
@@ -170,9 +171,11 @@
 		if exc_type:
 			self.__load_handle = None
 			self.__notify_status_changed()
-
-			# FIXME: check if it doesn't exist, and don't report error then
-			raise exc_type
+			
+			if gnomevfs.exists(local_song_info_uri):
+				raise exc_type
+			else:
+				return
 
 		parser = xml.sax.make_parser()
 		parser.setContentHandler(TrackListHandler(self.__db, self.__entry_type, self.__sku_dict, self.__home_dict))
@@ -191,8 +194,9 @@
 				self.__load_catalogue()
 			else:
 				# done downloading, move to real location
-				gnomevfs.async.xfer (source_uri_list = [magnatune_song_info_uri],
-						     target_uri_list = [local_song_info_temp_uri],
+				create_if_needed(local_song_info_uri, gnomevfs.OPEN_WRITE).close() # OPEN_NONE throws an exception
+				gnomevfs.async.xfer (source_uri_list = [local_song_info_temp_uri],
+						     target_uri_list = [local_song_info_uri],
 						     xfer_options = gnomevfs.XFER_DEFAULT,
 						     error_mode = gnomevfs.XFER_ERROR_MODE_ABORT,
 						     overwrite_mode = gnomevfs.XFER_OVERWRITE_MODE_REPLACE,
@@ -218,6 +222,7 @@
 
 	def __download_catalogue(self):
 		self.__updating = True
+		create_if_needed(local_song_info_temp_uri, gnomevfs.OPEN_WRITE).close()
 		self.__xfer_handle = gnomevfs.async.xfer (source_uri_list = [magnatune_song_info_uri],
 							  target_uri_list = [local_song_info_temp_uri],
 							  xfer_options = gnomevfs.XFER_FOLLOW_LINKS_RECURSIVE,
@@ -240,9 +245,11 @@
 				if issubclass (local_exc, gnomevfs.NotFoundError):
 					# we haven't got it yet
 					print "no local copy of catalogue"
+					self.__download_catalogue()
 				else:
 					# error locating local file
 					print "error locating local catalogue", local_exc
+					self.__download_catalogue()
 			else:
 				try:
 					if remote_info.mtime > local_info.mtime:
@@ -291,7 +298,7 @@
 		name = self.__client.get_string(self.__plugin.gconf_keys['ccname'])
 		email = self.__client.get_string(self.__plugin.gconf_keys['email'])
 
-		print "purchasing tracks:", sku, pay, format, ccnumber, year, month, name, email
+		print "purchasing tracks:", sku, pay, format, ccnumber, ccyear, ccmonth, name, email
 
 		### FIXME: all code below here needs reviewing
 		dlg = gtk.Dialog(title="Connecting: Please Wait")
@@ -302,7 +309,7 @@
 		try:
 			self.__buy_track(sku, pay, format, name, email, ccnumber, ccyear, ccmonth)
 			dlg.destroy()
-		except MagnatuneError, e:
+		except MagnatunePurchaseError, e:
 			dlg.destroy()
 			error_dlg = gtk.Dialog(title="Error", flags=gtk.DIALOG_DESTROY_WITH_PARENT, buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK))
 			label = gtk.Label(_("An error occurred while trying to purchase the album.\nThe Magnatune server returned:\n%s") % str(e))
@@ -312,12 +319,12 @@
 			error_dlg.connect("response", lambda w, r: w.destroy())
 			error_dlg.show()
 
-	def __buy_track(self, sku, pay, format, name, email, ccnumber, ccyear, ccmonth): # http://magnatune.com/info/api#purchas
+	def __buy_track(self, sku, pay, format, name, email, ccnumber, ccyear, ccmonth): # http://magnatune.com/info/api#purchase
 		url = "https://magnatune.com/buy/buy_dl_cc_xml?"
 		url = url + urllib.urlencode({
 						'id':	magnatune_partner_id,
 						'sku':	sku,
-						'amount': amount,
+						'amount': pay,
 						'cc':	ccnumber,
 						'yy':	ccyear,
 						'mm':	ccmonth,
@@ -335,7 +342,7 @@
 		audio_dl_uri.user_name = str(buy_album_handler.username) # URI objects don't like unicode strings
 		audio_dl_uri.password = str(buy_album_handler.password)
 		
-		library_location = client.get_list("/apps/rhythmbox/library_locations", gconf.VALUE_STRING)[0] # Just use the first library location
+		library_location = self.__client.get_list("/apps/rhythmbox/library_locations", gconf.VALUE_STRING)[0] # Just use the first library location
 		to_file_uri = gnomevfs.URI(library_location + "/" + audio_dl_uri.short_name)
 		
 		dl_file = gnomevfs.open(audio_dl_uri)
@@ -357,7 +364,7 @@
 				self.purchase_downloaded = 0
 				self.purchase_filesize = dl_file.get_file_info().size
 				
-				self.progress_dialog = gtk.glade.XML(self.find_file("magnatune-download.glade"))
+				self.progress_dialog = gtk.glade.XML(self.__plugin.find_file("magnatune-download.glade"))
 				self.progress_dialog.signal_autoconnect(callbacks)
 				self.cancelled = False
 				self.progress_dialog.get_widget("download_window").show()
@@ -392,7 +399,7 @@
 			self.progress_dialog.get_widget("download_window").destroy()
 			self.progress_dialog = None
 			self.purchase_filesize = 0
-			self.db.add_uri("file://" + urllib.quote(track_uri.dirname))
+			self.__db.add_uri("file://" + urllib.quote(track_uri.dirname))
 			return False
 
 
Only in ./magnatune: Makefile
Only in ./magnatune: Makefile.in
diff -ur /home/adam/rhythmbox/plugins/magnatune/magnatune-loading.glade ./magnatune-loading.glade
--- /home/adam/rhythmbox/plugins/magnatune/magnatune-loading.glade	2006-07-07 09:44:13.000000000 +0300
+++ ./magnatune-loading.glade	2006-07-07 09:43:22.000000000 +0300
@@ -29,7 +29,7 @@
       <child>
 	<widget class="GtkLabel" id="label1">
 	  <property name="visible">True</property>
-	  <property name="label" translatable="yes">&lt;b&gt;MagnaTune online music store&lt;/b&gt;</property>
+	  <property name="label" translatable="yes">&lt;b&gt;Magnatune online music store&lt;/b&gt;</property>
 	  <property name="use_underline">False</property>
 	  <property name="use_markup">True</property>
 	  <property name="justify">GTK_JUSTIFY_CENTER</property>
diff -ur /home/adam/rhythmbox/plugins/magnatune/magnatune-purchase.glade ./magnatune-purchase.glade
--- /home/adam/rhythmbox/plugins/magnatune/magnatune-purchase.glade	2006-07-07 09:44:13.000000000 +0300
+++ ./magnatune-purchase.glade	2006-07-07 09:42:54.000000000 +0300
@@ -5,7 +5,7 @@
 
 <widget class="GtkDialog" id="purchase_dialog">
   <property name="visible">True</property>
-  <property name="title" translatable="yes">dialog1</property>
+  <property name="title" translatable="yes">Purchase Album</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_NONE</property>
   <property name="modal">False</property>
Only in ./: magnatune.rb-plugin
Only in ./: Makefile
diff -ur /home/adam/rhythmbox/plugins/magnatune/Makefile.am ./Makefile.am
--- /home/adam/rhythmbox/plugins/magnatune/Makefile.am	2006-07-07 09:44:13.000000000 +0300
+++ ./Makefile.am	2006-07-06 18:54:10.000000000 +0300
@@ -11,9 +11,10 @@
 plugin_in_files = magnatune.rb-plugin.desktop.in
 
 glade_DATA =	\
-		magnatune-confirm.glade			\
+		magnatune-loading.glade			\
 		magnatune-download.glade		\
-		magnatune-prefs.glade
+		magnatune-prefs.glade			\
+		magnatune-purchase.glade
 
 gladedir = $(pkgdatadir)/glade
 EXTRA_DIST = $(plugin_in_files) $(glade_DATA)
Only in ./: Makefile.in
