send processing album colors to a background thread

- use white color as default album page play button color
- return 404 if album is None on get_album_bio()
This commit is contained in:
geoffrey45
2022-07-02 08:21:10 +03:00
committed by Mungai Geoffrey
parent 34a214df22
commit 77a5d2b7c2
7 changed files with 44 additions and 68 deletions
+6 -1
View File
@@ -80,12 +80,17 @@ def get_album_bio():
"""Returns the album bio for the given album."""
data = request.get_json()
album_hash = data["hash"]
err_msg = {"bio": "No bio found"}
album = instances.album_instance.find_album_by_hash(album_hash)
if album is None:
return err_msg, 404
bio = FetchAlbumBio(album["title"], album["artist"])()
if bio is None:
return {"bio": "No bio found."}, 404
return err_msg, 404
return {"bio": bio}