feat: P2V 파이프라인 연동 및 좋아요·댓글·공유 지원

- 무빙 포스터(p2v_video)·롱컷(p2v_playreel) 파이프라인과 워커, 갤러리·내 콘텐츠 노출
- 좋아요·댓글: comment/video_reaction에 p2v_playreel_id 추가, 종류별 CHECK 확장
- P2V 소프트 삭제(is_deleted), queued/running 삭제 차단
- 공개 상세·공유 OG 페이지 추가
- 삭제된 부모 댓글이 목록에서 사라지던 has_live_reply 서브쿼리 버그 수정
- 마이그레이션: migration_2026-10-15_p2v_reactions.sql
This commit is contained in:
skkim committed 2026-10-15 10:42:30 +09:00
1 parent bb1ea12958
commit b16d4a8f1b
126 files changed
+6921 -62

No files matched your search

+14 -3
View File
@@ -44,6 +44,11 @@ from app.database.like_cache import (
from app.credit.exceptions import InsufficientCreditError
from app.credit.services.credit_service import deduct_credit_for_job
from app.ssulbox.constants import JOB_TYPE_VIDEO as CREDIT_JOB_TYPE_VIDEO
from app.p2v.services.public_content import (
P2V_TYPES,
REACTION_COLUMN,
public_exists_query,
)
from app.ssulbox.models import SsulContent
from app.utils.logger import get_logger
from app.video.models import Video, VideoReaction
@@ -1055,14 +1060,17 @@ async def get_all_videos(
)
async def toggle_like(
video_id: int,
type: Literal["video", "ssul"] = Query(
type: Literal["video", "ssul", "p2v_video", "p2v_playreel"] = Query(
default="video",
description="콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 반드시 함께 보낼 것",
description=(
"콘텐츠 종류 (video: ADO2 영상, ssul: 썰박스, p2v_video: 무빙 포스터, "
"p2v_playreel: 롱컷). id 가 종류별로 겹치므로 반드시 함께 보낼 것"
),
),
current_user: User = Depends(get_current_user),
session: AsyncSession = Depends(get_session),
) -> LikeToggleResponse:
"""영상/썰박스 좋아요를 토글합니다.
"""영상/썰박스/P2V 좋아요를 토글합니다.
Write-Behind 패턴:
1. Redis user-set / count를 즉시 원자적으로 업데이트 (Lua script)
@@ -1088,6 +1096,9 @@ async def toggle_like(
)
# DB backfill 시 반응 행을 찾는 컬럼 — 썰박스 행은 content_id 가 채워져 있다
target_col = VideoReaction.content_id
elif type in P2V_TYPES:
exists_q = public_exists_query(type, video_id)
target_col = REACTION_COLUMN[type]
else:
exists_q = select(Video.id).where(
Video.id == video_id,