fix: delayed waveform loading (#538)

This commit is contained in:
2025-08-06 10:22:51 -06:00
committed by GitHub
parent d12424848d
commit 7963cc8a52
2 changed files with 1 additions and 19 deletions

View File

@@ -51,24 +51,6 @@ async def transcript_get_audio_mp3(
transcript_id, user_id=user_id transcript_id, user_id=user_id
) )
if transcript.audio_location == "storage":
# proxy S3 file, to prevent issue with CORS
url = await transcript.get_audio_url()
headers = {}
copy_headers = ["range", "accept-encoding"]
for header in copy_headers:
if header in request.headers:
headers[header] = request.headers[header]
async with httpx.AsyncClient() as client:
resp = await client.request(request.method, url, headers=headers)
return Response(
content=resp.content,
status_code=resp.status_code,
headers=resp.headers,
)
if transcript.audio_location == "storage": if transcript.audio_location == "storage":
# proxy S3 file, to prevent issue with CORS # proxy S3 file, to prevent issue with CORS
url = await transcript.get_audio_url() url = await transcript.get_audio_url()

View File

@@ -32,7 +32,7 @@ export default function TranscriptDetails(details: TranscriptDetails) {
const topics = useTopics(transcriptId); const topics = useTopics(transcriptId);
const waveform = useWaveform( const waveform = useWaveform(
transcriptId, transcriptId,
waiting || mp3.loading || mp3.audioDeleted === true, waiting || mp3.audioDeleted === true,
); );
const useActiveTopic = useState<Topic | null>(null); const useActiveTopic = useState<Topic | null>(null);