From a5b7529f17db216e2b057487e398339b930d684a 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?feat:=20=EB=AC=B4=EB=B9=99=20=ED=8F=AC=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=20YouTube=20=EC=97=85=EB=A1=9C=EB=93=9C=20=EC=97=B0?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SocialPostingModal.tsx | 16 +++++----- src/pages/Dashboard/MyContentsPage.tsx | 6 ++-- src/pages/Poster/PosterResultContent.tsx | 38 +++++++++++++++++++++++- src/types/api.ts | 4 +-- 4 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/components/SocialPostingModal.tsx b/src/components/SocialPostingModal.tsx index f93e9a3..cd774cd 100644 --- a/src/components/SocialPostingModal.tsx +++ b/src/components/SocialPostingModal.tsx @@ -199,8 +199,8 @@ const SocialPostingModal: React.FC = ({ const now = Date.now(); const seoKey = - video?.type === 'ssul' - ? `ssul:${video.video_id}` + video && video.type !== 'video' + ? `${video.type}:${video.video_id}` : video?.task_id || null; const expired = now - loadedAtRef.current > SEO_CACHE_TTL; @@ -244,20 +244,20 @@ const SocialPostingModal: React.FC = ({ /** * 제목·설명·태그 자동 채움. * - * `seoKey` 는 호출부가 만든 캐시 키다(ADO2=task_id, 썰박스=`ssul:{id}`). - * 백엔드에 보낼 식별자는 종류마다 다르다 — ADO2 는 task_id(UUID), 썰박스는 - * ssul_content.id 문자열이며, 서버가 content_type 으로 어느 테이블을 볼지 가른다. + * `seoKey` 는 호출부가 만든 캐시 키다(ADO2=task_id, 썰박스=`ssul:{id}`, 무빙 포스터=`p2v_video:{id}`). + * 백엔드에 보낼 식별자는 종류마다 다르다 — ADO2 는 task_id(UUID), 썰박스·무빙 포스터는 + * 콘텐츠 id 문자열이며, 서버가 content_type 으로 어느 테이블을 볼지 가른다. */ const loadAutocomplete = async (seoKey: string) => { if (!video) return; - const isSsul = video.type === 'ssul'; - if (!isSsul && !video.task_id) return; + const byContentId = video.type !== 'video'; + if (!byContentId && !video.task_id) return; setIsLoadingAutoDescription(true); try { const requestPayload = { content_type: video.type, - task_id: isSsul ? String(video.video_id) : video.task_id, + task_id: byContentId ? String(video.video_id) : video.task_id, }; const autoSeoResponse = await getAutoSeoYoutube(requestPayload); diff --git a/src/pages/Dashboard/MyContentsPage.tsx b/src/pages/Dashboard/MyContentsPage.tsx index 4386a97..106a65f 100644 --- a/src/pages/Dashboard/MyContentsPage.tsx +++ b/src/pages/Dashboard/MyContentsPage.tsx @@ -184,8 +184,8 @@ const MyContentsPage: React.FC = ({ onNavigate, embedded }) }; const handleUploadClick = (video: VideoListItem) => { - // P2V 는 소셜 업로드를 지원하지 않는다(버튼도 막는다) - if (isP2vContent(video.type)) return; + // 롱컷(p2v_playreel)은 소셜 업로드를 지원하지 않는다(버튼도 막는다). 무빙 포스터는 지원한다. + if (video.type === 'p2v_playreel') return; setUploadTargetVideo({ ...video, type: video.type }); setUploadModalOpen(true); }; @@ -334,7 +334,7 @@ const MyContentsPage: React.FC = ({ onNavigate, embedded }) + )} + setShowSocialModal(false)} + video={uploadItem} + /> + diff --git a/src/types/api.ts b/src/types/api.ts index fc8a1d2..aab35ce 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -330,8 +330,8 @@ export interface VideosListResponse { has_prev: boolean; } -/** 소셜 업로드 모달이 받는 항목 — P2V 는 업로드 API 가 없어 제외한다 */ -export type SocialUploadableItem = VideoListItem & { type: Exclude }; +/** 소셜 업로드 모달이 받는 항목 — 무빙 포스터(p2v_video)까지 업로드를 지원하고 롱컷(p2v_playreel)은 제외한다 */ +export type SocialUploadableItem = VideoListItem & { type: Exclude }; // 댓글 대댓글 export interface CommentReply {