feat: p2v_video 공유 페이지 설명에 내레이션 사용

This commit is contained in:
skkim committed 2026-10-15 16:47:39 +09:00
1 parent da99360cb7
commit 23a2ab4013
3 files changed
+13 -3

No files matched your search

+3 -2
View File
@@ -11,7 +11,8 @@ from sqlalchemy.ext.asyncio import AsyncSession
from app.database.session import get_session
from app.p2v.constants import JOB_TYPE_PLAYREEL, JOB_TYPE_VIDEO
from app.p2v.schemas.public import P2vDetailResponse
from app.p2v.services.public_content import fetch_public, like_state, poster_of
from app.p2v.services.public_content import (fetch_public, like_state, narration_text_of,
poster_of)
from app.user.dependencies.auth import get_current_user_optional
from app.user.models import User
from app.utils.upload_blob_as_request import to_playback_url
@@ -57,7 +58,7 @@ async def share_page(
raise HTTPException(404, "공유 가능한 콘텐츠를 찾을 수 없습니다.")
html = build_p2v_share_html(
P2vShareData(ctype=ctype, content_id=row.id, poster_url=poster_of(ctype, row),
name=row.name),
name=row.name, description=narration_text_of(ctype, row)),
share_url=resolve_share_url(
request.headers,
str(request.url).split("?", maxsplit=1)[0],
+8
View File
@@ -60,6 +60,14 @@ def poster_of(ctype: str, row) -> str | None:
return row.thumbnail_url if ctype == JOB_TYPE_VIDEO else playreel_thumbnail_url(row)
def narration_text_of(ctype: str, row) -> str | None:
"""공유 설명으로 쓰는 내레이션 한 줄. 무빙 포스터만 지원하고 없으면 None."""
if ctype != JOB_TYPE_VIDEO:
return None
lines = [str(line).strip() for line in row.narration_lines or [] if line]
return " ".join(line for line in lines if line) or None
async def like_state(
session: AsyncSession, ctype: str, content_id: int, user_uuid: str | None
) -> tuple[int, bool]:
+2 -1
View File
@@ -166,6 +166,7 @@ class P2vShareData:
content_id: int
poster_url: str | None
name: str | None = None
description: str | None = None
def build_p2v_share_html(
@@ -181,7 +182,7 @@ def build_p2v_share_html(
detail_path=f"{path_prefix}/{data.content_id}",
poster_url=data.poster_url,
title=_share_title(data.name, fallback_title, fallback_store=fallback_title),
description=_share_description(None),
description=_share_description(data.description),
share_url=share_url,
frontend_base_url=frontend_base_url,
configured_default_image_url=configured_default_image_url,