完成转录功能,中文脚本搜索,播放界面显示脚本

This commit is contained in:
2025-10-25 19:22:41 +08:00
parent d1b4fb6be0
commit 0d18595b68
34 changed files with 1827 additions and 404 deletions
+6 -3
View File
@@ -3,7 +3,7 @@ import BackButton from "@/app/components/BackButton";
import AwemeDetailClient from "./Client";
import type { Metadata } from "next";
import { getFileUrl } from "@/lib/minio";
import { AwemeData } from "./types";
import { AwemeData, VideoTranscript } from "./types";
export async function generateMetadata({ params }: { params: Promise<{ awemeId: string }> }): Promise<Metadata> {
const id = (await params).awemeId;
@@ -82,13 +82,16 @@ export default async function AwemeDetail({ params }: { params: Promise<{ awemeI
const aweme = post!
return {
type: "image" as const,
images: aweme!.images.map(img => ({ ...img, url: getFileUrl(img.url), animated: getFileUrl(img.animated??'default-animated.png'), })),
images: aweme!.images.map(img => ({ ...img, url: getFileUrl(img.url), animated: getFileUrl(img.animated ?? 'default-animated.png'), })),
music_url: getFileUrl(aweme!.music_url || 'default-music.mp3'),
};
}
})()
}
const transcript: VideoTranscript | null = isVideo ? await prisma.videoTranscript.findUnique({
where: { videoId: id },
}) : null;
// Compute prev/next neighbors by created_at across videos and image posts
const currentCreatedAt = (isVideo ? video!.created_at : post!.created_at);
@@ -125,7 +128,7 @@ export default async function AwemeDetail({ params }: { params: Promise<{ awemeI
className="inline-flex items-center justify-center w-9 h-9 rounded-full bg-white/15 text-white border border-white/20 backdrop-blur hover:bg-white/25"
/>
</div>
<AwemeDetailClient data={data} neighbors={neighbors} />
<AwemeDetailClient data={data} neighbors={neighbors} transcript={transcript} />
</main>
);
}