diff --git a/server.py b/server.py index 160712e..f186088 100644 --- a/server.py +++ b/server.py @@ -2003,7 +2003,12 @@ async def get_cached(content_hash: str, request: Request): ipfs_cid = cache_item.get("ipfs_cid") if cache_item else None file_size = cache_path.stat().st_size - media_type = detect_media_type(cache_path) + # Use stored type from metadata, fall back to auto-detection + stored_type = meta.get("type") if meta else None + if stored_type == "recipe": + media_type = "recipe" + else: + media_type = detect_media_type(cache_path) logger.info(f"get_cached: JSON response, ipfs_cid={ipfs_cid[:16] if ipfs_cid else 'None'}..., took {time.time()-start:.3f}s") return { "content_hash": content_hash,