rhythmbox r5647 - in trunk: . plugins/magnatune/magnatune



Author: jmatthew
Date: Wed Mar 26 10:29:01 2008
New Revision: 5647
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5647&view=rev

Log:
2008-03-26  Jonathan Matthew  <jonathan d14n org>

	* plugins/magnatune/magnatune/TrackListHandler.py:
	Use ogg previews in preference to mp3.  Fixes #397097.


Modified:
   trunk/ChangeLog
   trunk/plugins/magnatune/magnatune/TrackListHandler.py

Modified: trunk/plugins/magnatune/magnatune/TrackListHandler.py
==============================================================================
--- trunk/plugins/magnatune/magnatune/TrackListHandler.py	(original)
+++ trunk/plugins/magnatune/magnatune/TrackListHandler.py	Wed Mar 26 10:29:01 2008
@@ -39,10 +39,16 @@
 	def endElement(self, name):
 		if name == "Track":
 			try:
+				# prefer ogg streams to mp3
+				if 'oggurl' in self.__track:
+					trackurl = self.__track['oggurl']
+				else:
+					trackurl = self.__track['url']
+	
 				# add the track to the source
-				entry = self.__db.entry_lookup_by_location (self.__track['url'])
+				entry = self.__db.entry_lookup_by_location (trackurl)
 				if entry == None:
-					entry = self.__db.entry_new(self.__entry_type, self.__track['url'])
+					entry = self.__db.entry_new(self.__entry_type, trackurl)
 
 				# if year is not set, use launch date instead
 				try:
@@ -70,7 +76,7 @@
 				self.__db.set(entry, rhythmdb.PROP_GENRE, self.__track['mp3genre'])
 				self.__db.set(entry, rhythmdb.PROP_DURATION, duration)
 
-				key = str(self.__track['url'])
+				key = str(trackurl)
 				sku = intern(str(self.__track['albumsku']))
 				self.__sku_dict[key] = sku
 				self.__home_dict[sku] = str(self.__track['home'])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]