swingmusic/app/api/colors.py
geoffrey45 d43dcbff46 break down store.py into multiple files in a module
+ fix last updated date bug
2023-03-25 03:05:38 +03:00

14 lines
308 B
Python

from flask import Blueprint
from app.store.albums import AlbumStore as 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]
}