fix/refac: stt default content type

This commit is contained in:
Timothy Jaeryang Baek
2025-12-22 09:45:55 +04:00
parent 7f0ca8c4b7
commit 4ab917c74b
3 changed files with 6 additions and 3 deletions
+1 -2
View File
@@ -1151,10 +1151,9 @@ def transcription(
user=Depends(get_verified_user),
):
log.info(f"file.content_type: {file.content_type}")
stt_supported_content_types = getattr(
request.app.state.config, "STT_SUPPORTED_CONTENT_TYPES", []
) or ["audio/*", "video/webm"]
)
if not strict_match_mime_type(stt_supported_content_types, file.content_type):
raise HTTPException(
+1 -1
View File
@@ -114,7 +114,7 @@ def process_uploaded_file(request, file, file_path, file_item, file_metadata, us
if file.content_type:
stt_supported_content_types = getattr(
request.app.state.config, "STT_SUPPORTED_CONTENT_TYPES", []
) or ["audio/*", "video/webm"]
)
if strict_match_mime_type(stt_supported_content_types, file.content_type):
file_path = Storage.get_file(file_path)