add function to validate albums

+ extract colors in watchdogg
+ rename color db files
This commit is contained in:
mungai-njoroge
2023-07-12 08:56:30 +03:00
parent 4a7416853a
commit 861a854f91
18 changed files with 170 additions and 38 deletions
+5 -7
View File
@@ -8,11 +8,9 @@ api = Blueprint("colors", __name__, url_prefix="/colors")
def get_album_color(albumhash: str):
album = Store.get_album_by_hash(albumhash)
if len(album.colors) > 0:
return {
"color": album.colors[0]
}
msg = {"color": ""}
return {
"color": ""
}
if album is None or len(album.colors) == 0:
return msg, 404
return {"color": album.colors[0]}