rpms/rhythmbox/devel rhythmbox-coherence-media-store-fixes.patch, NONE, 1.1 rhythmbox.spec, 1.132, 1.133

Bastien Nocera (hadess) fedora-extras-commits at redhat.com
Tue Oct 2 12:20:23 UTC 2007


Author: hadess

Update of /cvs/pkgs/rpms/rhythmbox/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11440

Modified Files:
	rhythmbox.spec 
Added Files:
	rhythmbox-coherence-media-store-fixes.patch 
Log Message:
* Tue Oct 02 2007 - Bastien Nocera <bnocera at redhat.com> - 0.11.2-7
- Add upstream patch to make the Upnp media store work (GNOME #482548)


rhythmbox-coherence-media-store-fixes.patch:

--- NEW FILE rhythmbox-coherence-media-store-fixes.patch ---
Index: MediaStore.py
===================================================================
--- MediaStore.py	(revision 5374)
+++ MediaStore.py	(working copy)
@@ -2,6 +2,7 @@
 
 import rhythmdb
 import louie
+import urllib
 from coherence.upnp.core import DIDLLite
 
 
@@ -22,12 +23,13 @@
         self.parent_id = parent_id
         self.name = name
         self.mimetype = 'directory'
-        self.item = DIDLLite.StorageFolder(id, parent_id,self.name)
+        self.item = DIDLLite.Container(id, parent_id,self.name)
         self.update_id = 0
         if children_callback != None:
             self.children = children_callback
         else:
             self.children = []
+        self.item.childCount = self.get_child_count()
 
     def add_child(self, child):
         self.children.append(child)
@@ -75,18 +77,33 @@
 
 		# load common values
 		entry = self.store.db.entry_lookup_by_id (self.id)
-		bitrate = self.store.db.entry_get (entry, rhythmdb.PROP_BITRATE)
-		duration = self.store.db.entry_get (entry, rhythmdb.PROP_DURATION)
+		# Bitrate is in bytes/second, not kilobits/second
+		bitrate = self.store.db.entry_get (entry, rhythmdb.PROP_BITRATE) * 1024 / 8
+		# Duration is in HH:MM:SS format
+		seconds = self.store.db.entry_get (entry, rhythmdb.PROP_DURATION)
+		hours = seconds / 3600
+		seconds = seconds - hours * 3600
+		minutes = seconds / 60
+		seconds = seconds - minutes * 60
+		duration = ("%02d:%02d:%02d") % (hours, minutes, seconds)
+
 		location = self.store.db.entry_get (entry, rhythmdb.PROP_LOCATION)
+		if location.startswith("file://"):
+			location = unicode(urllib.url2pathname(location)[len("file://"):])
+		else:
+			location = None
 		mimetype = self.store.db.entry_get (entry, rhythmdb.PROP_MIMETYPE)
+		# This isn't a real mime-type
+		if mimetype == "application/x-id3":
+			mimetype = "audio/mpeg"
 		size = self.store.db.entry_get (entry, rhythmdb.PROP_FILE_SIZE)
 
 		# create item
 		item = DIDLLite.MusicTrack(self.id + CONTAINER_COUNT)
 		item.album = self.store.db.entry_get (entry, rhythmdb.PROP_ALBUM)
-		##item.albumArtURI = ## can we somehow store art in the upnp share??
+		#item.albumArtURI = ## can we somehow store art in the upnp share??
 		item.artist = self.store.db.entry_get (entry, rhythmdb.PROP_ARTIST)
-		##item.date =
+		#item.date =
 		item.genre = self.store.db.entry_get (entry, rhythmdb.PROP_GENRE)
 		item.originalTrackNumber = str(self.store.db.entry_get (entry, rhythmdb.PROP_TRACK_NUMBER))
 		item.title = self.store.db.entry_get (entry, rhythmdb.PROP_TITLE) # much nicer if it was entry.title
@@ -125,11 +142,10 @@
 		entry = self.store.db.entry_lookup_by_id (self.id)
 		uri = self.store.db.entry_get (entry, rhythmdb.PROP_LOCATION)
 		if uri.startswith("file://"):
-			return uri[len("file://"):]
+			return unicode(urllib.url2pathname(uri)[len("file://"):])
 		else:
 			return None
 
-
 class MediaStore: 
 	implements = ['MediaServer']
 
Index: __init__.py
===================================================================
--- __init__.py	(revision 5374)
+++ __init__.py	(working copy)
@@ -8,11 +8,6 @@
 		rb.Plugin.__init__(self)
 			
 	def activate(self, shell):
-		self.coherence = self.get_coherence()
-		if self.coherence is None:
-			print "Coherence is not installed or too old, aborting"
-			return
-
 		from twisted.internet import gtk2reactor
 		try:
 			gtk2reactor.install()
@@ -20,6 +15,11 @@
 			# sometimes it's already installed
 			print e
 
+		self.coherence = self.get_coherence()
+		if self.coherence is None:
+			print "Coherence is not installed or too old, aborting"
+			return
+
 		print "coherence UPnP plugin activated"
 		self.shell = shell
 		self.sources = {}
@@ -42,6 +42,8 @@
 		if self.coherence is None:
 			return
 
+		self.coherence.shutdown()
+
 		louie.disconnect(self.detected_media_server,
 				'Coherence.UPnP.ControlPoint.MediaServer.detected',
 				louie.Any)


Index: rhythmbox.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rhythmbox/devel/rhythmbox.spec,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -r1.132 -r1.133
--- rhythmbox.spec	20 Sep 2007 18:21:53 -0000	1.132
+++ rhythmbox.spec	2 Oct 2007 12:19:50 -0000	1.133
@@ -3,7 +3,7 @@
 Name: rhythmbox
 Summary: Music Management Application 
 Version: 0.11.2
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: GPLv2+ and GFDL+
 Group: Applications/Multimedia
 URL: http://www.gnome.org/projects/rhythmbox/
@@ -45,6 +45,7 @@
 
 ExcludeArch:    s390 s390x
 
+Patch0: rhythmbox-coherence-media-store-fixes.patch
 Patch1: rhythmbox-upnp-assert.patch
 Patch2: rhythmbox-enable-stores.patch
 
@@ -75,6 +76,9 @@
 %prep
 %setup -q
 
+pushd plugins/coherence/upnp_coherence/
+%patch0 -p0 -b .media-store-fixes
+popd
 %patch1 -p0 -b .upnp-assert
 pushd data/
 %patch2 -p0 -b .enable-stores
@@ -189,6 +193,9 @@
 %{_libdir}/rhythmbox/plugins/upnp_coherence
 
 %changelog
+* Tue Oct 02 2007 - Bastien Nocera <bnocera at redhat.com> - 0.11.2-7
+- Add upstream patch to make the Upnp media store work (GNOME #482548)
+
 * Thu Sep 20 2007 - Bastien Nocera <bnocera at redhat.com> - 0.11.2-6
 - Init pygobject threads early (GNOME #469852)
 




More information about the scm-commits mailing list