mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
0af1ae1d8e
+ fix #193 (settings https redirect) + fix open api docs on binary + fix git error on binary + remove flask-restful hopefully, I didn't break something 😩
26 lines
716 B
Python
26 lines
716 B
Python
from flask_openapi3 import Tag
|
|
from flask_openapi3 import APIBlueprint
|
|
|
|
from app.api.apischemas import GenericLimitSchema
|
|
from app.lib.home.recentlyadded import get_recent_items
|
|
from app.lib.home.recentlyplayed import get_recently_played
|
|
|
|
bp_tag = Tag(name="Home", description="Homepage items")
|
|
api = APIBlueprint("home", __name__, url_prefix="/home", abp_tags=[bp_tag])
|
|
|
|
|
|
@api.get("/recents/added")
|
|
def get_recently_added(query: GenericLimitSchema):
|
|
"""
|
|
Get recently added
|
|
"""
|
|
return {"items": get_recent_items(query.limit)}
|
|
|
|
|
|
@api.get("/recents/played")
|
|
def get_recent_plays(query: GenericLimitSchema):
|
|
"""
|
|
Get recently played
|
|
"""
|
|
return {"items": get_recently_played(query.limit)}
|