fix(extension): attach an optional video transcript to image uploads

The cover-image form can carry a transcript job. Callers that omit it
leave the field off the request.
This commit is contained in:
tianma-if committed 2026-10-07 16:53:43 +08:00
1 parent 350766cba3
commit 86da442eb4
2 files changed
+9

No files matched your search

+1
View File
@@ -267,6 +267,7 @@ const imageNoteClient = (settings: ExtensionSettings): ImageNoteClient => ({
form.append("title", body.title);
form.append("contentMarkdown", body.contentMarkdown);
form.append("tags", JSON.stringify(body.tags));
if (body.videoTranscript) form.append("videoTranscript", JSON.stringify(body.videoTranscript));
form.append("file", new File([buffer], body.filename, { type: body.mimeType }));
const created = await edgeEverFormRequest<{ memo: { id: string }; resourceId: string }>(
settings,
+8
View File
@@ -289,6 +289,14 @@ export type ImageNoteClient = {
filename: string;
mimeType: string;
bytes: Uint8Array;
videoTranscript?: {
platform: "youtube" | "bilibili";
videoId: string;
sourceUrl: string;
durationSeconds: number;
placeholderText: string;
transcriptLabel: string;
};
}) => Promise<{ memoId: string; resourceId: string }>;
};