add CharacterAnalzyer, fix DtrEntry (I think)

This commit is contained in:
rootdarkarchon
2023-07-10 13:23:44 +02:00
parent 2473087da4
commit 417c08f9b2
7 changed files with 170 additions and 29 deletions

View File

@@ -1,4 +1,5 @@
using MareSynchronos.Interop;
using LZ4;
using MareSynchronos.Interop;
using MareSynchronos.MareConfiguration;
using MareSynchronos.Utils;
using Microsoft.Extensions.Logging;
@@ -137,6 +138,13 @@ public sealed class FileCacheManager : IDisposable
return validatedCacheEntry;
}
public async Task<(string, byte[])> GetCompressedFileData(string fileHash, CancellationToken uploadToken)
{
var fileCache = GetFileCacheByHash(fileHash)!.ResolvedFilepath;
return (fileHash, LZ4Codec.WrapHC(await File.ReadAllBytesAsync(fileCache, uploadToken).ConfigureAwait(false), 0,
(int)new FileInfo(fileCache).Length));
}
public void RemoveHashedFile(FileCacheEntity? fileCache)
{
if (fileCache == null) return;