🐛 Fix bugs

This commit is contained in:
LittleSheep 2025-04-15 00:22:36 +08:00
parent b9fc1907fc
commit 15cb1cbbf3

@ -204,7 +204,12 @@ app.MapTus("/files/tus", (_) => Task.FromResult<DefaultTusConfiguration>(new()
var fileService = eventContext.HttpContext.RequestServices.GetRequiredService<FileService>();
var info = await fileService.AnalyzeFileAsync(account, file.Id, fileStream, fileName, contentType);
var (info, processedStream) = await fileService.AnalyzeFileAsync(account, file.Id, fileStream, fileName, contentType);
// Write the processed stream to the disk
var tusPath = builder.Configuration.GetSection("Tus").GetValue<string>("StorePath")!;
var tusFilePath = Path.Combine(tusPath, file.Id);
await using var fileStreamWriter = new FileStream(tusFilePath, FileMode.Create, FileAccess.Write);
await processedStream.CopyToAsync(fileStreamWriter);
var jsonOptions = httpContext.RequestServices.GetRequiredService<IOptions<JsonOptions>>().Value
.JsonSerializerOptions;