add route to fetch album color

This commit is contained in:
geoffrey45
2023-03-19 23:37:01 +03:00
parent 598e3d4c79
commit e23f2a6489
2 changed files with 15 additions and 1 deletions
+13
View File
@@ -0,0 +1,13 @@
from flask import Blueprint
from app.db.store import Store
api = Blueprint("colors", __name__, url_prefix="/colors")
@api.route("/album/<albumhash>")
def get_album_color(albumhash: str):
album = Store.get_album_by_hash(albumhash)
return {
"color": album.colors[0]
}