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:
@@ -9,7 +9,7 @@ from app.core.database import get_session
|
||||
from app.core.redis import enqueue
|
||||
from app.models.notes import NoteItem, NoteAttachment
|
||||
from app.schemas.notes import NoteCreate, NoteUpdate, NoteResponse
|
||||
from app.services.media import save_image, save_audio, delete_media, ALLOWED_IMAGE_TYPES, ALLOWED_AUDIO_TYPES
|
||||
from app.services.media import save_image, save_audio, delete_media, ALLOWED_IMAGE_TYPES, ALLOWED_AUDIO_PREFIXES
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -130,10 +130,11 @@ async def add_attachment(
|
||||
if not note:
|
||||
raise HTTPException(404, "Note introuvable")
|
||||
|
||||
if file.content_type in ALLOWED_IMAGE_TYPES:
|
||||
ct = (file.content_type or "").lower().split(";")[0].strip()
|
||||
if ct in ALLOWED_IMAGE_TYPES:
|
||||
media = await save_image(file, context="note")
|
||||
file_type = "image"
|
||||
elif file.content_type in ALLOWED_AUDIO_TYPES:
|
||||
elif ct in ALLOWED_AUDIO_PREFIXES:
|
||||
media = await save_audio(file)
|
||||
file_type = "audio"
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user