Fix download links to use /raw endpoint

Download links now point to /cache/{hash}/raw which returns proper
Content-Type headers and filename with extension.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-09 12:47:32 +00:00
parent f9b7f784e5
commit d72b5e0e50

View File

@@ -584,7 +584,7 @@ async def ui_activity_detail(activity_index: int, request: Request):
<video src="{l1_server}/cache/{content_hash}/mp4" controls autoplay muted loop playsinline
class="max-w-full max-h-96 mx-auto rounded-lg"></video>
<div class="mt-3 text-center">
<a href="{l1_server}/cache/{content_hash}" download
<a href="{l1_server}/cache/{content_hash}/raw" download
class="inline-block px-4 py-2 bg-green-600 hover:bg-green-700 text-white font-medium rounded-lg transition-colors">
Download Original
</a>
@@ -608,7 +608,7 @@ async def ui_activity_detail(activity_index: int, request: Request):
content_html = f'''
<div class="bg-dark-600 rounded-lg p-4 mb-6 text-center">
<p class="text-gray-400 mb-3">Content type: {media_type or obj_type}</p>
<a href="{l1_server}/cache/{content_hash}" download
<a href="{l1_server}/cache/{content_hash}/raw" download
class="inline-block px-4 py-2 bg-green-600 hover:bg-green-700 text-white font-medium rounded-lg transition-colors">
Download
</a>
@@ -820,7 +820,7 @@ async def ui_asset_detail(name: str, request: Request):
<video src="{l1_server}/cache/{content_hash}/mp4" controls autoplay muted loop playsinline
class="max-w-full max-h-96 mx-auto rounded-lg"></video>
<div class="mt-3 text-center">
<a href="{l1_server}/cache/{content_hash}" download
<a href="{l1_server}/cache/{content_hash}/raw" download
class="inline-block px-4 py-2 bg-green-600 hover:bg-green-700 text-white font-medium rounded-lg transition-colors">
Download Original
</a>
@@ -868,7 +868,7 @@ async def ui_asset_detail(name: str, request: Request):
<h3 class="text-lg font-semibold text-white mb-3">Recipe Source</h3>
<pre class="bg-dark-900 p-4 rounded-lg overflow-x-auto text-sm text-gray-300 font-mono whitespace-pre-wrap"><code>{recipe_source_escaped}</code></pre>
<div class="mt-3 text-center">
<a href="{l1_server}/cache/{content_hash}" download
<a href="{l1_server}/cache/{content_hash}/raw" download
class="inline-block px-4 py-2 bg-green-600 hover:bg-green-700 text-white font-medium rounded-lg transition-colors">
Download YAML
</a>
@@ -879,7 +879,7 @@ async def ui_asset_detail(name: str, request: Request):
content_html = f'''
<div class="bg-dark-600 rounded-lg p-4 mb-6 text-center">
<p class="text-gray-400 mb-3">Content type: {asset_type}</p>
<a href="{l1_server}/cache/{content_hash}" download
<a href="{l1_server}/cache/{content_hash}/raw" download
class="inline-block px-4 py-2 bg-green-600 hover:bg-green-700 text-white font-medium rounded-lg transition-colors">
Download
</a>