feat: multimodal video detection + reply/forward/crosspost + batch optimization
- Video frame extraction via ffmpeg (4 key frames per video → vision LLM) - Video display in FE MessageCard with HTML5 <video> player - Reply/forward/crosspost indicator in FE + pipeline in DG/BE - Fix: missing sanitizeAiContent + escapeXml in media path (prompt injection) - Optimize: text-only batch results saved to DB immediately, no longer wait for media analysis - BE mapper/schema/repo: add reference fields (is_reply, is_forward, etc.)
This commit is contained in:
@@ -134,6 +134,12 @@ export class MessagesRepository {
|
||||
type: data.type ?? "text",
|
||||
metadata: null,
|
||||
ai_status: "pending",
|
||||
is_reply: data.isReply ?? false,
|
||||
is_forward: data.isForward ?? false,
|
||||
is_crosspost: data.isCrosspost ?? false,
|
||||
reference_message_id: data.referenceMessageId ?? null,
|
||||
reference_channel_id: data.referenceChannelId ?? null,
|
||||
reference_guild_id: data.referenceGuildId ?? null,
|
||||
})
|
||||
.returning();
|
||||
|
||||
@@ -260,6 +266,12 @@ export class MessagesRepository {
|
||||
ai_severity: pgMessagesTable.ai_severity,
|
||||
ai_confidence: pgMessagesTable.ai_confidence,
|
||||
ai_analysis: pgMessagesTable.ai_analysis,
|
||||
is_reply: pgMessagesTable.is_reply,
|
||||
is_forward: pgMessagesTable.is_forward,
|
||||
is_crosspost: pgMessagesTable.is_crosspost,
|
||||
reference_message_id: pgMessagesTable.reference_message_id,
|
||||
reference_channel_id: pgMessagesTable.reference_channel_id,
|
||||
reference_guild_id: pgMessagesTable.reference_guild_id,
|
||||
})
|
||||
.from(pgMessagesTable)
|
||||
.where(and(...conditions))
|
||||
|
||||
@@ -19,6 +19,12 @@ export const messageCreateSchema = z.object({
|
||||
avatarUrl: z.string().optional(),
|
||||
content: z.string(),
|
||||
type: z.enum(["text", "edited", "deleted"]).default("text"),
|
||||
isReply: z.boolean().optional(),
|
||||
isForward: z.boolean().optional(),
|
||||
isCrosspost: z.boolean().optional(),
|
||||
referenceMessageId: z.string().optional(),
|
||||
referenceChannelId: z.string().optional(),
|
||||
referenceGuildId: z.string().optional(),
|
||||
});
|
||||
|
||||
export const messageUpdateSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user