mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
add function to validate albums
+ extract colors in watchdogg + rename color db files
This commit is contained in:
+5
-7
@@ -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]}
|
||||
|
||||
Reference in New Issue
Block a user