Unknown playlist type PLACEHOLDER #159

Closed
rckclmbr opened this Issue May 8, 2015 · 1 comment

Projects

None yet

2 participants

@rckclmbr
rckclmbr commented May 8, 2015

In rckclmbr/pyportify#25, someone has a playlist of type PLACEHOLDER, which is actually a documented playlist type, although I can't for the life of me figure out what it is.

You have it listed as a playlist type, but aren't handling it when loading

Any idea on how to resolve this?

2015-05-08 13:36:48,698 - pyportify.views - ERROR - Exception on /spotify/playlists [GET]
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Library/Python/2.7/site-packages/pyportify/views.py", line 142, in spotify_playlists
    ret_playlists = fetch_spotify_playlists()
  File "/Library/Python/2.7/site-packages/pyportify/views.py", line 156, in fetch_spotify_playlists
    for playlist in playlists:
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py", line 581, in __iter__
    v = self[i]
  File "/Library/Python/2.7/site-packages/spotify/__init__.py", line 60, in wrapper
    return f(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/spotify/playlist_container.py", line 193, in __getitem__
    raise spotify.Error('Unknown playlist type: %r' % playlist_type)
Error: Unknown playlist type: <PlaylistType.PLACEHOLDER: 3>
127.0.0.1 - - [2015-05-08 13:36:48] "GET /spotify/playlists HTTP/1.1" 500 412 0.038552
@jodal
Member
jodal commented May 8, 2015

According to the libspotify docs:

SP_PLAYLIST_TYPE_PLACEHOLDER Unknown entry.

So I guess all we can do is to ignore it instead of crashing.

@jodal jodal added this to the v2.0.0 milestone May 8, 2015
@jodal jodal self-assigned this May 8, 2015
@jodal jodal added the bug label May 8, 2015
@jodal jodal added a commit that closed this issue May 8, 2015
@jodal jodal playlist: Return PlaylistPlaceholder object
Instead of raising exception if a playlist container element is of the
type PLACEHOLDER.

Fixes #159
f8224e8
@jodal jodal closed this in f8224e8 May 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment