mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
fix: delayed waveform loading (#538)
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user