swingmusic/app/api/colors.py
geoffrey45 5487dad27b fix duplicate artist and album color entry in db
+ Remove folder store
+ Reduce fuzzy search score cutoff from 90% to 75%
+ use inheritance to init Artist class
+ misc
2023-03-26 18:01:26 +03:00

19 lines
390 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)
if len(album.colors) > 0:
return {
"color": album.colors[0]
}
return {
"color": ""
}