Update UI & Syncshell Public & MCDF Share

This commit is contained in:
2025-11-01 19:55:49 +01:00
parent 513845b811
commit 8cc4f34c55
22 changed files with 1949 additions and 298 deletions

View File

@@ -11,6 +11,7 @@ using MareSynchronos.Services.CharaData.Models;
using MareSynchronos.Utils;
using MareSynchronos.WebAPI.Files;
using Microsoft.Extensions.Logging;
using System.Threading;
namespace MareSynchronos.Services;
@@ -295,6 +296,32 @@ public sealed class CharaDataFileHandler : IDisposable
}
}
internal async Task<byte[]?> CreateCharaFileBytesAsync(string description, CancellationToken token = default)
{
var tempFilePath = Path.Combine(Path.GetTempPath(), "umbra_mcdfshare_" + Guid.NewGuid().ToString("N") + ".mcdf");
try
{
await SaveCharaFileAsync(description, tempFilePath).ConfigureAwait(false);
if (!File.Exists(tempFilePath)) return null;
token.ThrowIfCancellationRequested();
return await File.ReadAllBytesAsync(tempFilePath, token).ConfigureAwait(false);
}
finally
{
try
{
if (File.Exists(tempFilePath))
{
File.Delete(tempFilePath);
}
}
catch
{
// ignored
}
}
}
internal async Task<List<string>> UploadFiles(List<string> fileList, ValueProgress<string> uploadProgress, CancellationToken token)
{
return await _fileUploadManager.UploadFiles(fileList, uploadProgress, token).ConfigureAwait(false);