swingmusic/app/api/colors.py
2023-03-19 23:37:01 +03:00

14 lines
290 B
Python

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