From 65a7404c87dfdddbc8d311998670118cdb91c97f Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 11 Jan 2026 09:28:51 -0600 Subject: [PATCH] fix: use proper signed URL generation for accessible video preview The generate_signed_url() was called with expiration=3600 as an integer, but GCS expects a datetime or timedelta. Now uses gcs_service.get_signed_url() which properly calculates the expiration timestamp. Co-Authored-By: Claude Opus 4.5 --- backend/app/api/v1/routes_jobs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/app/api/v1/routes_jobs.py b/backend/app/api/v1/routes_jobs.py index 3339be2..4b987f8 100644 --- a/backend/app/api/v1/routes_jobs.py +++ b/backend/app/api/v1/routes_jobs.py @@ -1520,8 +1520,11 @@ async def get_accessible_video_edit_state( accessible_video_url = None if accessible_video_gcs: blob_path = accessible_video_gcs.replace(f"gs://{settings.gcs_bucket}/", "") - blob = gcs_service.bucket.blob(blob_path) - accessible_video_url = blob.generate_signed_url(expiration=3600) + try: + accessible_video_url = await gcs_service.get_signed_url(blob_path, expiration_hours=1) + except HTTPException: + # File may not exist yet + accessible_video_url = None # Convert to response format return AccessibleVideoEditStateResponse(