From cf6949acf799e9f149f2490a141ec75bbea8944d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=B1=EA=B2=BD?= Date: Fri, 16 Oct 2026 11:29:42 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=AC=B4=EB=B9=99=20=ED=8F=AC=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=20=EB=AA=A9=EB=A1=9D=EC=9D=98=20SNS=20=EB=A9=94?= =?UTF-8?q?=ED=83=80=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=85=B8=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/video/services/unified_list.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/app/video/services/unified_list.py b/app/video/services/unified_list.py index 6f8e423..527a82b 100644 --- a/app/video/services/unified_list.py +++ b/app/video/services/unified_list.py @@ -269,8 +269,15 @@ def _ssul_branch(where: list, sort_by: str) -> Select: return select(*cols).where(*where) -def _p2v_branch(ctype: str, model, video_col, poster_col, sort_by: str) -> Select: - """무빙 포스터·롱컷 공용. 포스터 컬럼이 없는 종류(롱컷)는 NULL 로 두고 `_to_items` 가 채운다.""" +def _p2v_branch( + ctype: str, model, video_col, poster_col, sort_by: str, *, has_sns_metadata: bool = False +) -> Select: + """무빙 포스터·롱컷 공용. 포스터 컬럼이 없는 종류(롱컷)는 NULL 로 두고 `_to_items` 가 채운다. + + `has_sns_metadata` 인 종류(무빙 포스터)는 title/description/hashtags 를 **저장된 SNS 메타데이터**로 + 내려보낸다(ADO2·썰박스와 같은 의미 — 없으면 NULL). 작업 이름을 title 로 내리면 업로드 모달이 + SEO 자동 채움을 건너뛰고 빈 설명·태그로 업로드해 저장값을 덮어쓴다. + """ cols = [ literal(ctype).label("ctype"), model.id.label("cid"), @@ -280,9 +287,9 @@ def _p2v_branch(ctype: str, model, video_col, poster_col, sort_by: str) -> Selec model.created_at.label("created_at"), literal("").label("task_id"), (poster_col if poster_col is not None else literal(None, String)).label("poster_url"), - model.name.label("title"), - literal(None, String).label("description"), - literal(None, String).label("hashtags"), + (model.title if has_sns_metadata else model.name).label("title"), + (model.description if has_sns_metadata else literal(None, String)).label("description"), + (model.hashtags if has_sns_metadata else literal(None, String)).label("hashtags"), ] if sort_by == SORT_LIKE: cols.append(_p2v_like_subq(ctype, model).label("sort_value")) @@ -293,7 +300,8 @@ def _p2v_branch(ctype: str, model, video_col, poster_col, sort_by: str) -> Selec def _p2v_video_branch(where: list, sort_by: str) -> Select: return _p2v_branch(CT_P2V_VIDEO, PosterAliveTask, PosterAliveTask.video_url, - PosterAliveTask.thumbnail_url, sort_by).where(*where) + PosterAliveTask.thumbnail_url, sort_by, + has_sns_metadata=True).where(*where) def _p2v_playreel_branch(where: list, sort_by: str) -> Select: