diff --git a/server.py b/server.py index 405687c..2f23aa2 100644 --- a/server.py +++ b/server.py @@ -3623,9 +3623,20 @@ async def ui_publish_run(run_id: str, request: Request, output_name: str = Form( resp.raise_for_status() result = resp.json() - # Pin the output + # Pin the output and record L2 share if run.output_hash: await database.update_item_metadata(run.output_hash, ctx.actor_id, pinned=True, pin_reason="published") + # Record L2 share so UI shows published status + cache_path = get_cache_path(run.output_hash) + media_type = detect_media_type(cache_path) if cache_path else "image" + content_type = "video" if media_type == "video" else "image" + await database.save_l2_share( + content_hash=run.output_hash, + actor_id=ctx.actor_id, + l2_server=l2_server, + asset_name=result["asset"]["name"], + content_type=content_type + ) # Pin the inputs (for provenance) for input_hash in run.inputs: