feat: add manual video tagging

This commit is contained in:
2026-04-29 21:20:21 +08:00
parent 02d37f3953
commit eac6ad2343
17 changed files with 1066 additions and 418 deletions
+29 -20
View File
@@ -27,26 +27,35 @@ export async function GET() {
},
});
const formattedVideos = videos.map((v) => ({
aweme_id: v.aweme_id,
desc: v.desc,
cover_url: getFileUrl(v.cover_url ?? ""),
duration_ms: v.duration_ms,
author: {
nickname: v.author.nickname,
},
transcript: v.transcript
? {
id: v.transcript.id,
speech_detected: v.transcript.speech_detected,
language: v.transcript.language,
audio_type: v.transcript.audio_type,
transcript: v.transcript.transcript,
non_speech_summary: v.transcript.non_speech_summary,
content_tags: v.transcript.content_tags,
}
: null,
}));
const formattedVideos = videos.map((v) => {
const contentTags =
v.manual_content_tags.length > 0
? v.manual_content_tags
: (v.transcript?.content_tags ?? []);
return {
aweme_id: v.aweme_id,
desc: v.desc,
cover_url: getFileUrl(v.cover_url ?? ""),
duration_ms: v.duration_ms,
manual_content_tags: v.manual_content_tags,
content_tags: contentTags,
author: {
nickname: v.author.nickname,
},
transcript: v.transcript
? {
id: v.transcript.id,
speech_detected: v.transcript.speech_detected,
language: v.transcript.language,
audio_type: v.transcript.audio_type,
transcript: v.transcript.transcript,
non_speech_summary: v.transcript.non_speech_summary,
content_tags: v.transcript.content_tags,
}
: null,
};
});
return NextResponse.json({
videos: formattedVideos,