From 3c4965462ac54a60b10ab365b2c31127c7f31408 Mon Sep 17 00:00:00 2001 From: ajaysi Date: Wed, 22 Apr 2026 12:56:48 +0530 Subject: [PATCH] Add debug logging to asset serving to see file content --- backend/api/assets_serving.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/api/assets_serving.py b/backend/api/assets_serving.py index b9ad6037..527b16e3 100644 --- a/backend/api/assets_serving.py +++ b/backend/api/assets_serving.py @@ -99,5 +99,10 @@ async def serve_voice_sample( raise HTTPException(status_code=404, detail="Asset not found") media_type = _get_media_type(safe_filename) - logger.info(f"[Assets] Serving voice sample: {safe_filename} ({media_type}, {file_path.stat().st_size} bytes)") + file_size = file_path.stat().st_size + first_bytes_hex = "N/A" + if file_size > 0: + with open(file_path, 'rb') as f: + first_bytes_hex = f.read(16).hex() + logger.warning(f"[Assets] Serving voice sample: {safe_filename} ({media_type}, {file_size} bytes, first_16hex: {first_bytes_hex})") return FileResponse(file_path, media_type=media_type) \ No newline at end of file