GNOME Bugzilla – Bug 504414
[upnp] export the media collection in a 'all tracks', 'artists' and 'albums' structure
Last modified: 2008-02-05 12:03:54 UTC
the attached patch adds the first attempts to export the media collection in a structure like this: All Tracks -- track 1 -- track 2 -- ... Artists -- Artist 1 -- All Tracks -- Album 1 -- track 1 -- ... -- Artist 2 -- ... Albums -- Album 1 -- track 1 -- ... -- Album 2 -- ... I can retrieve from the rhythmdb the artists and the albums. What's missing now is the query for the albums of one artist, the tracks of one artist and the tracks of one album sorted by track number.
Created attachment 101243 [details] [review] patch to MediaStore.py to export the media collection a bit more structured
Created attachment 102904 [details] [review] this exports the rb music db in 'All tracks', 'Albums' and 'Artists' folders exporting the rb music db in a more structured way, and adding a link to Coherence and (c) myself to the plugin description
Patch doesn't apply cleanly, there's a 150-lines hunk failing to apply against SVN trunk (probably due to the changes from bug #509148). Could you please resync your patch?
Created attachment 102988 [details] [review] this exports the rb music db in 'All tracks', 'Albums' and 'Artists' folders this version of the patch is based on svn revision 5544
I don't see any tracks within the folders, and the PS3 complains about "DNLA protocol error 500". I'll post logs later.
(In reply to comment #5) > I don't see any tracks within the folders, and the PS3 complains about "DNLA > protocol error 500". I'll post logs later. > 500 is probably a crash somewhere in Coherence, if you start rb from the shell you should see it. As it works here, we maybe have some version conflict. :-/
Using Coherence 0.4.0: Traceback (most recent call last):
+ Trace 185757
self.factory.page(response)
self.deferred.callback((page, self.response_headers))
self._startRunCallbacks(result)
self._runCallbacks() --- <exception caught here> ---
self.result = callback(self.result, *args, **kw)
elt = DIDLLite.DIDLElement.fromString(result['Result'])
elt = elt.getroot()
Traceback (most recent call last): File "/usr/lib64/python2.5/site-packages/twisted/web/server.py", line 167, in render body = resrc.render(self) File "/usr/lib/python2.5/site-packages/coherence/upnp/core/soap_service.py", line 151, in render d = defer.maybeDeferred(function, *args, **keywords) File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 107, in maybeDeferred result = f(*args, **kw) File "/usr/lib/python2.5/site-packages/coherence/upnp/core/service.py", line 762, in soap__generic d = defer.maybeDeferred( callit, *args, **kwargs) --- <exception caught here> --- File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 107, in maybeDeferred result = f(*args, **kw) File "/usr/lib/python2.5/site-packages/coherence/upnp/core/service.py", line 753, in callit return callback( **kwargs) File "/usr/lib/python2.5/site-packages/coherence/upnp/services/servers/content_directory_server.py", line 158, in upnp_Browse r['UpdateID'] = self.backend.update_id # FIXME exceptions.AttributeError: 'MediaStore' object has no attribute 'update_id' Traceback (most recent call last): File "/usr/lib64/python2.5/site-packages/twisted/web/server.py", line 167, in render body = resrc.render(self) File "/usr/lib/python2.5/site-packages/coherence/upnp/core/soap_service.py", line 151, in render d = defer.maybeDeferred(function, *args, **keywords) File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 107, in maybeDeferred result = f(*args, **kw) File "/usr/lib/python2.5/site-packages/coherence/upnp/core/service.py", line 762, in soap__generic d = defer.maybeDeferred( callit, *args, **kwargs) --- <exception caught here> --- File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 107, in maybeDeferred result = f(*args, **kw) File "/usr/lib/python2.5/site-packages/coherence/upnp/core/service.py", line 753, in callit return callback( **kwargs) File "/usr/lib/python2.5/site-packages/coherence/upnp/services/servers/content_directory_server.py", line 158, in upnp_Browse r['UpdateID'] = self.backend.update_id # FIXME exceptions.AttributeError: 'MediaStore' object has no attribute 'update_id' I'll give a try with 0.5.0 tomorrow
Created attachment 103127 [details] [review] this exports the rb music db in 'All tracks', 'Albums' and 'Artists' folders there was one class attribute missing - older version of Coherence didn't use it, and the newer ones ignore it gracefully when not there. Now the MediaStore should work with all Coherence versions again.
A few more. It seems it stops processing when it encountered invalid UTF-8 names. The list is truncated when it gets to that point, and some files show up as unsupported data, even though they're MP3s. Unhandled error in Deferred: Traceback (most recent call last):
+ Trace 185859
callbackKeywords=kw)
self._runCallbacks()
d = defer.maybeDeferred( i.get_item) --- <exception caught here> ---
result = f(*args, **kw)
location = unicode(urllib.url2pathname(location)[len("file://"):])
(In reply to comment #9) > location = unicode(urllib.url2pathname(location)[len("file://"):]) > exceptions.UnicodeDecodeError: 'utf8' codec can't decode bytes in position > 52-54: invalid data that line isn't touched by the patch, so shouldn't we have gotten these errors with the old version too? <title>Stück Vom Himmel</title> <artist>Herbert Grönemeyer</artist> <location>file:///data/audio/music/Herbert%20Gr%C3%B6nemeyer%20-%20Zw%C3%B6lf/01_herbert_groenemeyer_-_stueck_vom_himmel.mp3</location> I have quite some files like that with umlauts, but they get properly exported. Maybe we add some log output to identify the offending file?
Created attachment 103190 [details] [review] this exports the rb music db in 'All tracks', 'Albums' and 'Artists' folders with some additional debug output to track down the filename/location unicode issues
This has been superseed by the patch on bug 512870, which I just committed.