mopidy / mopidy-soundcloud

Mopidy extension for playing music from SoundCloud
https://mopidy.com/ext/soundcloud/
MIT License
185 stars 59 forks source link

Error with likes #43

Closed flyingrub closed 8 years ago

flyingrub commented 9 years ago
ERROR    Unhandled exception in MpdSession (urn:uuid:fbfd0421-ab77-4aa1-90ff-bfb6c1c8ead0):
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 366, in on_receive
    self.on_line_received(line)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/session.py", line 33, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 46, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 75, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 85, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 104, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 133, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 146, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 158, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 167, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/protocol/__init__.py", line 178, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/protocol/__init__.py", line 156, in validate
    return func(**callargs)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/protocol/music_db.py", line 413, in lsinfo
    for path, lookup_future in context.browse(uri, recursive=False):
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 319, in browse
    for ref in future.get():
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 73, in browse
    return backend.library.browse(uri).get()
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/share/mopidy/mopidy_soundcloud/library.py", line 148, in browse
    return self.list_liked()
  File "/usr/share/mopidy/mopidy_soundcloud/library.py", line 60, in list_liked
    logger.debug('Adding liked track %s to vfs' % data.name)
AttributeError: 'list' object has no attribute 'name'
flyingrub commented 9 years ago

i think name should be replaced by title. Why don't you use the soundcloud python wrapper its way more easier to code with it :)

https://github.com/soundcloud/soundcloud-python example of use here : https://github.com/flyingrub/scdl

shark0der commented 9 years ago

Bumping this issue. Can't see/play my liked songs :(

kantholtz commented 9 years ago

As the error message suggests, there is a list in self.backend.remote_get_user_liked(). I have not looked at the code extensively but a very quick and dirty fix ist just to add this in library.py:

def list_liked(self):
    vfs_list = collections.OrderedDict()
    for data in self.backend.remote.get_user_liked():
        if type(data) == list:
            continue
        ...

This is working for me but it would be better to find out why there is an empty list in the result set of self.backend.remote.get_user_liked() in the first place.

devonbarrett commented 9 years ago

Bump

s00500 commented 9 years ago

Bump! This is still an issue, thanks for the workaround, works for me as well!

artistro08 commented 9 years ago

bump

jodal commented 8 years ago

Fixed by #69