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 authored and Mungai Geoffrey committed 2022-07-06 17:38:33 +03:00
1 parent 34a214df22
commit 77a5d2b7c2
7 files changed
+44 -68

No files matched your search

+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}