Merge pull request #2823 from waweic/patch-2

Fix album_art() in __init__.py
This commit is contained in:
Adrian Sampson 2018-02-28 12:16:32 -05:00 committed by GitHub
commit 7fae3dadec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -285,8 +285,8 @@ def album_query(queries):
@app.route('/album/<int:album_id>/art')
def album_art(album_id):
album = g.lib.get_album(album_id)
if album.artpath:
return flask.send_file(album.artpath)
if album and album.artpath:
return flask.send_file(album.artpath.decode())
else:
return flask.abort(404)

View file

@ -71,6 +71,10 @@ Fixes:
* :doc:`/plugins/web`: The time display in the web interface would incorrectly jump
at the 30-second mark of every minute. Now, it correctly changes over at zero
seconds. :bug:`2822`
* :doc:`/plugins/web`: In a python 3 enviroment, the function to fetch the
album art would not work and throw an exception. It now works as expected.
Additionally, the server will now return a 404 response when the album id
is unknown, instead of a 500 response and a thrown exception. :bug:`2823`
For developers: