first recommendation draft

This commit is contained in:
cwilvx
2024-10-25 23:26:08 +03:00
parent a26373669d
commit c4a73f0d63
15 changed files with 393 additions and 6 deletions
+13
View File
@@ -5,6 +5,7 @@ from flask_openapi3 import APIBlueprint
from app.api.apischemas import GenericLimitSchema
from app.lib.home.recentlyadded import get_recently_added_items
from app.lib.home.recentlyplayed import get_recently_played
from app.store.homepage import HomepageStore
bp_tag = Tag(name="Home", description="Homepage items")
api = APIBlueprint("home", __name__, url_prefix="/home", abp_tags=[bp_tag])
@@ -24,3 +25,15 @@ def get_recent_plays(query: GenericLimitSchema):
Get recently played
"""
return {"items": get_recently_played(query.limit)}
@api.get("/")
def homepage_items():
return {
"artist_mixes": {
"title": "Artist mixes for you",
"description": "Curated based on artists you have played in the past",
"items": HomepageStore.get_artist_mixes(),
"extra": {},
},
}