fossfreedom / rhythmweb

rhythmbox v2.9x/v3.x GTK3 port of the original rhythmweb GTK2 plugin created previously for rhythmbox v0.1x
GNU General Public License v3.0
23 stars 8 forks source link

Endpoint "/playlist/current" Fails, throws 500 if Track Playing has Album Art #30

Open ghost opened 6 years ago

ghost commented 6 years ago

If a playing track has Album Art, requesting /playlist/current will result in a 500 Server Error.

Re-creating:

  1. Attach Album art to a Song and begin playing it
  2. Request the /playlist/current Endpoint. curl localhost:8000/playlist/current
  3. You should be served a 500 Server Error with the body: A server error occurred. Please contact the administrator.

Traceback using rhythmbox -D rhythmweb

127.0.0.1 - - [07/Apr/2018 12:01:25] "GET /playlist/current HTTP/1.1" 200 106
Traceback (most recent call last):
  File "/usr/lib/python3.5/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/lib/rhythmbox/plugins/rhythmweb/rhythmweb.py", line 235, in _wsgi
    return self._handle_current(response)
  File "/usr/lib/rhythmbox/plugins/rhythmweb/rhythmweb.py", line 500, in _handle_current
    return iostring(json.dumps(return_data))
  File "/usr/lib/python3.5/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.5/json/encoder.py", line 179, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <RB.ExtDBKey object at 0x7fece803b588 (RBExtDBKey at 0x2580f80)> is not JSON serializable

Using RhythmBox 3.3

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/56764643-endpoint-playlist-current-fails-throws-500-if-track-playing-has-album-art?utm_campaign=plugin&utm_content=tracker%2F2163146&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F2163146&utm_medium=issues&utm_source=github).