video/status render data 비디오 id 추가
This commit is contained in:
1 parent
1512691504
commit
ed616e4f66
2 files changed
+5
No files matched your search
@@ -550,6 +550,7 @@ async def get_video_status(
|
|||||||
}
|
}
|
||||||
message = status_messages.get(status, f"상태: {status}")
|
message = status_messages.get(status, f"상태: {status}")
|
||||||
|
|
||||||
|
video_id = None
|
||||||
# succeeded 상태인 경우 백그라운드 태스크 실행
|
# succeeded 상태인 경우 백그라운드 태스크 실행
|
||||||
if status == "succeeded" and video_url:
|
if status == "succeeded" and video_url:
|
||||||
# creatomate_render_id로 Video 조회하여 task_id 가져오기
|
# creatomate_render_id로 Video 조회하여 task_id 가져오기
|
||||||
@@ -561,6 +562,8 @@ async def get_video_status(
|
|||||||
)
|
)
|
||||||
video = video_result.scalar_one_or_none()
|
video = video_result.scalar_one_or_none()
|
||||||
|
|
||||||
|
video_id = video.id
|
||||||
|
|
||||||
if video and video.status != "completed":
|
if video and video.status != "completed":
|
||||||
# 이미 완료된 경우 백그라운드 작업 중복 실행 방지
|
# 이미 완료된 경우 백그라운드 작업 중복 실행 방지
|
||||||
# 백그라운드 태스크로 MP4 다운로드 → Blob 업로드 → DB 업데이트 → 임시 파일 삭제
|
# 백그라운드 태스크로 MP4 다운로드 → Blob 업로드 → DB 업데이트 → 임시 파일 삭제
|
||||||
@@ -584,6 +587,7 @@ async def get_video_status(
|
|||||||
status=status,
|
status=status,
|
||||||
url=video_url,
|
url=video_url,
|
||||||
snapshot_url=result.get("snapshot_url"),
|
snapshot_url=result.get("snapshot_url"),
|
||||||
|
video_id = video_id if video_id else None
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class VideoRenderData(BaseModel):
|
|||||||
status: Optional[str] = Field(None, description="렌더 상태")
|
status: Optional[str] = Field(None, description="렌더 상태")
|
||||||
url: Optional[str] = Field(None, description="영상 URL")
|
url: Optional[str] = Field(None, description="영상 URL")
|
||||||
snapshot_url: Optional[str] = Field(None, description="스냅샷 URL")
|
snapshot_url: Optional[str] = Field(None, description="스냅샷 URL")
|
||||||
|
video_id: Optional[int] = Field(None, description="Video id(DB)")
|
||||||
|
|
||||||
|
|
||||||
class PollingVideoResponse(BaseModel):
|
class PollingVideoResponse(BaseModel):
|
||||||
|
|||||||
Reference in new issue
Block a user