Fix:HuggingFace渠道文件命名和读取问题

This commit is contained in:
MarSeventh
2026-01-08 19:51:34 +08:00
parent d629c5c727
commit 1ca7a284a5
26 changed files with 32 additions and 28 deletions

View File

@@ -22,7 +22,7 @@ export async function onRequestPost(context) {
}
const body = await request.json();
const { fullId, filePath, sha256, fileSize, fileName, channelName, multipartParts } = body;
const { fullId, filePath, sha256, fileSize, fileName, fileType, channelName, multipartParts } = body;
if (!fullId || !filePath || !sha256 || !fileSize) {
return new Response(JSON.stringify({
@@ -86,6 +86,7 @@ export async function onRequestPost(context) {
// 构建 metadata
const metadata = {
FileName: fileName || fullId,
FileType: fileType || null,
Channel: "HuggingFace",
ChannelName: hfChannel.name || "HuggingFace_env",
FileSize: (fileSize / 1024 / 1024).toFixed(2),