mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
add route to fetch album color
This commit is contained in:
@@ -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]
|
||||
}
|
||||
Reference in New Issue
Block a user