After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 504414 - [upnp] export the media collection in a 'all tracks', 'artists' and 'albums' structure
[upnp] export the media collection in a 'all tracks', 'artists' and 'albums' ...
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Plugins (other)
0.11.x
Other All
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-12-19 10:19 UTC by Frank Scholz
Modified: 2008-02-05 12:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to MediaStore.py to export the media collection a bit more structured (15.63 KB, patch)
2007-12-19 10:21 UTC, Frank Scholz
none Details | Review
this exports the rb music db in 'All tracks', 'Albums' and 'Artists' folders (19.87 KB, patch)
2008-01-15 15:07 UTC, Frank Scholz
needs-work Details | Review
this exports the rb music db in 'All tracks', 'Albums' and 'Artists' folders (20.02 KB, patch)
2008-01-16 12:24 UTC, Frank Scholz
none Details | Review
this exports the rb music db in 'All tracks', 'Albums' and 'Artists' folders (20.05 KB, patch)
2008-01-18 09:59 UTC, Frank Scholz
none Details | Review
this exports the rb music db in 'All tracks', 'Albums' and 'Artists' folders (20.02 KB, patch)
2008-01-19 10:10 UTC, Frank Scholz
none Details | Review

Description Frank Scholz 2007-12-19 10:19:42 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.
Comment 1 Frank Scholz 2007-12-19 10:21:16 UTC
Created attachment 101243 [details] [review]
patch to MediaStore.py to export the media collection a bit more structured
Comment 2 Frank Scholz 2008-01-15 15:07:54 UTC
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
Comment 3 Bastien Nocera 2008-01-16 11:29:34 UTC
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?
Comment 4 Frank Scholz 2008-01-16 12:24:54 UTC
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
Comment 5 Bastien Nocera 2008-01-16 18:14:55 UTC
I don't see any tracks within the folders, and the PS3 complains about "DNLA protocol error 500". I'll post logs later.
Comment 6 Frank Scholz 2008-01-16 19:02:11 UTC
(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. :-/
Comment 7 Bastien Nocera 2008-01-17 22:23:52 UTC
Using Coherence 0.4.0:

Traceback (most recent call last):
  • File "/usr/lib/python2.5/site-packages/coherence/upnp/core/utils.py", line 112 in handleResponse
    self.factory.page(response)
  • File "/usr/lib/python2.5/site-packages/coherence/upnp/core/utils.py", line 126 in page
    self.deferred.callback((page, self.response_headers))
  • File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 239 in callback
    self._startRunCallbacks(result)
  • File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 304 in _startRunCallbacks
    self._runCallbacks() --- <exception caught here> ---
  • File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 317 in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  • File "/usr/lib/python2.5/site-packages/coherence/upnp/services/clients/content_directory_client.py", line 70 in process_result
    elt = DIDLLite.DIDLElement.fromString(result['Result'])
  • File "/usr/lib/python2.5/site-packages/coherence/upnp/core/DIDLLite.py", line 535 in fromString
    elt = elt.getroot()
exceptions.AttributeError: 'NoneType' object has no attribute '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
Comment 8 Frank Scholz 2008-01-18 09:59:50 UTC
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.
Comment 9 Bastien Nocera 2008-01-18 17:54:14 UTC
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):
  • File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 191 in addCallback
    callbackKeywords=kw)
  • File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 182 in addCallbacks
    self._runCallbacks()
  • File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 317 in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  • File "/usr/lib/python2.5/site-packages/coherence/upnp/services/servers/content_directory_server.py", line 223 in process_result
    d = defer.maybeDeferred( i.get_item) --- <exception caught here> ---
  • File "/usr/lib64/python2.5/site-packages/twisted/internet/defer.py", line 107 in maybeDeferred
    result = f(*args, **kw)
  • File "/usr/lib64//rhythmbox/plugins/upnp_coherence/MediaStore.py", line 221 in get_item
    location = unicode(urllib.url2pathname(location)[len("file://"):])
exceptions.UnicodeDecodeError: 'utf8' codec can't decode bytes in position 52-54: invalid data

Comment 10 Frank Scholz 2008-01-19 09:46:11 UTC
(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&#xFC;ck Vom Himmel</title>
<artist>Herbert Gr&#xF6;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?
Comment 11 Frank Scholz 2008-01-19 10:10:54 UTC
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
Comment 12 James "Doc" Livingston 2008-02-05 12:03:54 UTC
This has been superseed by the patch on bug 512870, which I just committed.