This commit is contained in:
team3
2026-09-30 01:24:49 +02:00
parent 70b37054ba
commit ae5b1d0b1d
8 changed files with 209 additions and 2 deletions

View File

@@ -332,6 +332,33 @@ async def clip_aufnahmen():
return {"tage": []}
@app.get("/api/aufnahmen")
async def aufnahmen_liste(response: Response, filmabend_sid: str | None = Cookie(None)):
"""Alle Stücke der Aufnahme, neueste zuerst — für die Verwaltung."""
sid = sitzung(response, filmabend_sid)
if not users.ist_host(sid):
raise HTTPException(status_code=403, detail="Nur für den Host")
try:
return {"stuecke": await clips.aufnahmen_alle()}
except httpx.HTTPError:
raise HTTPException(status_code=502, detail="Die Aufnahmen sind gerade nicht erreichbar.")
@app.delete("/api/aufnahmen")
async def aufnahme_loeschen(
response: Response, start: str, dauer: float, filmabend_sid: str | None = Cookie(None)
):
"""Ein Stück der Aufnahme löschen — nur der Host."""
sid = sitzung(response, filmabend_sid)
if not users.ist_host(sid):
raise HTTPException(status_code=403, detail="Nur für den Host")
try:
anzahl = await clips.aufnahme_loeschen(start, dauer)
except httpx.HTTPError:
raise HTTPException(status_code=502, detail="Löschen hat nicht geklappt.")
return {"segmente": anzahl}
@app.get("/api/clips/von-film/{movie_id}")
async def clips_stuecke(
movie_id: int, response: Response, filmabend_sid: str | None = Cookie(None)