fix(backend): use correct lookup method for path-based workspace refs

When adding MIME type to workspace refs without fragments, use
get_file_info_by_path() for path-based refs instead of get_file_info()
which expects an ID.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nicholas Tindle
2026-02-04 22:09:09 -06:00
parent 2deb9b96cf
commit 5923e5c211

View File

@@ -368,7 +368,12 @@ async def store_media_file(
if not ws.mime_type:
# Add MIME type fragment if missing (older refs without it)
try:
info = await workspace_manager.get_file_info(ws.file_ref)
if ws.is_path:
info = await workspace_manager.get_file_info_by_path(
ws.file_ref
)
else:
info = await workspace_manager.get_file_info(ws.file_ref)
if info:
return MediaFileType(f"{file}#{info.mimeType}")
except Exception: