fix(audio+gps): lecture audio multi-navigateur + icône GPS dans tuile note
Audio : - MediaRecorder détecte le format supporté : webm (Chrome/Firefox) ou mp4 (Safari/iOS) - Extension sauvegardée correctement (.webm ou .m4a) selon le navigateur - Backend : ALLOWED_AUDIO_PREFIXES remplace le set strict, strip des codec suffixes GPS (note card) : - Icône fa-location-dot (accent vert) avec tooltip lat/lon remplace l'emoji 📍 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ ALLOWED_IMAGE_TYPES = {
|
||||
"image/jpeg", "image/jpg", "image/png", "image/webp", "image/svg+xml",
|
||||
"image/heic", "image/heif",
|
||||
}
|
||||
ALLOWED_AUDIO_TYPES = {"audio/webm", "audio/mp4"}
|
||||
ALLOWED_AUDIO_PREFIXES = {"audio/webm", "audio/mp4", "audio/ogg", "audio/x-m4a"}
|
||||
|
||||
MAX_ORIG_SIZE = (500, 500)
|
||||
|
||||
@@ -70,7 +70,8 @@ async def save_image(file: UploadFile, context: str = "note") -> dict:
|
||||
|
||||
|
||||
async def save_audio(file: UploadFile) -> dict:
|
||||
if file.content_type not in ALLOWED_AUDIO_TYPES:
|
||||
ct = (file.content_type or "").lower().split(";")[0].strip()
|
||||
if ct not in ALLOWED_AUDIO_PREFIXES:
|
||||
raise HTTPException(status_code=400, detail=f"Format audio non supporté : {file.content_type}")
|
||||
|
||||
file_id = str(uuid.uuid4())
|
||||
|
||||
Reference in New Issue
Block a user