- arte_api.py : GENRE_PAGES devient une liste de (nom, url), chaque concert reçoit un champ "categories" avec ses genres d'appartenance - main.py : endpoint /api/categories + param ?category= sur /api/concerts - index.html : barre de pills catégories (Tout + 10 genres) - style.css : styles .cat-bar / .cat-pill avec pill active en or - app.js : chargement dynamique des pills, filtre catégorie dans le state Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from pydantic import BaseModel
|
||||
|
||||
from arte_api import fetch_concerts, invalidate_cache
|
||||
from arte_api import fetch_concerts, invalidate_cache, CATEGORIES
|
||||
from downloader import DownloadManager
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
@@ -31,9 +31,14 @@ async def index(request: Request):
|
||||
# ------------------------------------------------------------------ API: concerts
|
||||
|
||||
|
||||
@app.get("/api/categories")
|
||||
async def api_categories():
|
||||
return CATEGORIES
|
||||
|
||||
|
||||
@app.get("/api/concerts")
|
||||
async def api_concerts(page: int = 1, search: str = "", page_size: int = 24):
|
||||
return await fetch_concerts(page=page, search=search, page_size=page_size)
|
||||
async def api_concerts(page: int = 1, search: str = "", page_size: int = 24, category: str = ""):
|
||||
return await fetch_concerts(page=page, search=search, page_size=page_size, category=category)
|
||||
|
||||
|
||||
@app.post("/api/refresh")
|
||||
|
||||
Reference in New Issue
Block a user