feat: support video detection based on media format field in frontend and backend
This commit is contained in:
parent
fe50550bb9
commit
d6546aeba6
2 changed files with 2 additions and 2 deletions
|
|
@ -577,7 +577,7 @@ export default new Elysia({ prefix: "/post" })
|
||||||
|
|
||||||
const { media: _media, ...tweetWithoutMedia } = tweetData.tweet;
|
const { media: _media, ...tweetWithoutMedia } = tweetData.tweet;
|
||||||
const normalizedTags = normalizeTags(body.tag || ["미분류"]);
|
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({
|
const result = await uploadAndCreateWithRetry({
|
||||||
fileName,
|
fileName,
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ export default function AddPage() {
|
||||||
const items: PreviewItem[] = mediaItems
|
const items: PreviewItem[] = mediaItems
|
||||||
.map((m) => ({
|
.map((m) => ({
|
||||||
url: (m as any).thumbnail_url || (m as any).url || "",
|
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);
|
.filter((item) => item.url.length > 0);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue