Skip to content

Commit

Permalink
check for the audiocast mp3 file in get_audiocast
Browse files Browse the repository at this point in the history
  • Loading branch information
nwaughachukwuma committed Nov 12, 2024
1 parent 653681c commit 112aa1c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/src/utils/get_audiocast.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from fastapi import HTTPException

from src.services.storage import StorageManager
from src.utils.generate_audiocast import GenerateAudioCastResponse
from src.utils.session_manager import SessionManager

Expand All @@ -10,6 +11,14 @@ def get_audiocast(session_id: str):
"""
Get audiocast based on session id
"""
try:
StorageManager().download_from_gcs(session_id)
except Exception:
raise HTTPException(
status_code=404,
detail=f"Failed to get audiocast for session_id: {session_id}",
)

session_data = SessionManager.data(session_id)
if not session_data:
raise HTTPException(
Expand Down

0 comments on commit 112aa1c

Please sign in to comment.