From 33d2d6be27a154722c717d59a72ff07521c126d6 Mon Sep 17 00:00:00 2001 From: krasi Date: Sat, 16 May 2026 19:02:40 +0200 Subject: [PATCH 1/2] feat(audio): add rename-title endpoint and inline edit UI --- backend/app/features/audio/router.py | 40 +++- backend/app/features/audio/schemas.py | 6 + backend/app/features/audio/service.py | 113 ++++++++++- frontend/app/(dashboard)/audio/page.tsx | 17 +- .../features/audio/components/AudioCard.tsx | 178 ++++++++++++++---- frontend/features/audio/hooks/useAudio.ts | 16 +- frontend/lib/api.ts | 10 + 7 files changed, 336 insertions(+), 44 deletions(-) diff --git a/backend/app/features/audio/router.py b/backend/app/features/audio/router.py index 2eb791e..0f51151 100644 --- a/backend/app/features/audio/router.py +++ b/backend/app/features/audio/router.py @@ -1,20 +1,38 @@ -"""Audio Library REST endpoints — list and delete saved audio entries.""" +"""Audio Library REST endpoints — list, delete, and temp-serve audio.""" import logging from uuid import UUID from fastapi import APIRouter, Depends, HTTPException, Request, status +from fastapi.responses import Response from app.core.limiter import limiter from app.core.security import get_current_user from app.features.auth.schemas import UserSchema from app.features.audio import service -from app.features.audio.schemas import AudioEntryOut +from app.features.audio.schemas import AudioEntryOut, AudioEntryPatch logger = logging.getLogger(__name__) router = APIRouter(prefix="/audio", tags=["audio"]) +@router.get("/temp/{token}") +async def serve_temp_audio(token: str) -> Response: + """Serve a temporarily stored mp3 before the user confirms saving. + + No JWT auth — the UUID token itself acts as a short-lived capability URL + (unguessable, 1-hour TTL). The browser