From d6546aeba683970e9e997535259de023d2514bda Mon Sep 17 00:00:00 2001 From: imnyang Date: Thu, 23 Apr 2026 19:21:03 +0900 Subject: [PATCH] feat: support video detection based on media format field in frontend and backend --- apps/backend/src/routes/post.ts | 2 +- apps/frontend/src/app/add/page.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/routes/post.ts b/apps/backend/src/routes/post.ts index d395c4d..d921751 100644 --- a/apps/backend/src/routes/post.ts +++ b/apps/backend/src/routes/post.ts @@ -577,7 +577,7 @@ export default new Elysia({ prefix: "/post" }) const { media: _media, ...tweetWithoutMedia } = tweetData.tweet; const normalizedTags = normalizeTags(body.tag || ["미분류"]); - const mediaType = (mediaItem.type === "video" || mediaItem.type === "gif") ? "video" : "image"; + const mediaType = (mediaItem.type === "video" || mediaItem.type === "gif" || (mediaItem.format && mediaItem.format.includes("video"))) ? "video" : "image"; const result = await uploadAndCreateWithRetry({ fileName, diff --git a/apps/frontend/src/app/add/page.tsx b/apps/frontend/src/app/add/page.tsx index 1ccc0dc..605c9a9 100644 --- a/apps/frontend/src/app/add/page.tsx +++ b/apps/frontend/src/app/add/page.tsx @@ -188,7 +188,7 @@ export default function AddPage() { const items: PreviewItem[] = mediaItems .map((m) => ({ url: (m as any).thumbnail_url || (m as any).url || "", - type: (((m as any).type === "video" || (m as any).type === "gif") ? "video" : "image") as "image" | "video" + type: (((m as any).type === "video" || (m as any).type === "gif" || ((m as any).format && (m as any).format.includes("video"))) ? "video" : "image") as "image" | "video" })) .filter((item) => item.url.length > 0);