fix: 무빙 포스터 목록의 SNS 메타데이터 노출

This commit is contained in:
skkim committed 2026-10-16 11:29:42 +09:00
1 parent 550dfd5709
commit cf6949acf7
1 file changed
+14 -6
+14 -6
View File
@@ -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: