feat: add week 3 audio and timeline enhancements
This commit is contained in:
@@ -24,6 +24,7 @@ from app.schemas.story_schemas import (
|
||||
GenerationRequest,
|
||||
GenerationResponse,
|
||||
StoryAssetRetryRequest,
|
||||
StoryAudioStatusResponse,
|
||||
StorybookRequest,
|
||||
StorybookResponse,
|
||||
StoryDetailResponse,
|
||||
@@ -395,8 +396,28 @@ async def get_story_audio(
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
"""Get story audio (MP3)."""
|
||||
audio_bytes = await story_service.generate_story_audio(story_id, user.id, db)
|
||||
return Response(content=audio_bytes, media_type="audio/mpeg")
|
||||
audio_bytes = await story_service.generate_story_audio(story_id, user.id, db)
|
||||
return Response(content=audio_bytes, media_type="audio/mpeg")
|
||||
|
||||
|
||||
@router.get("/audio/{story_id}/status", response_model=StoryAudioStatusResponse)
|
||||
async def get_story_audio_status(
|
||||
story_id: int,
|
||||
user: User = Depends(require_user),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
"""Get audio cache status without generating audio."""
|
||||
return await story_service.get_story_audio_status(story_id, user.id, db)
|
||||
|
||||
|
||||
@router.delete("/audio/{story_id}/cache", response_model=StoryAudioStatusResponse)
|
||||
async def delete_story_audio_cache(
|
||||
story_id: int,
|
||||
user: User = Depends(require_user),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
"""Clear cached story audio so it can be regenerated."""
|
||||
return await story_service.clear_story_audio_cache(story_id, user.id, db)
|
||||
|
||||
|
||||
@router.get("/stories/{story_id}/achievements", response_model=list[AchievementItem])
|
||||
|
||||
Reference in New Issue
Block a user