mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 22:17:22 +01:00
add migration to file extensions for mare storage
This commit is contained in:
parent
176fc9560b
commit
f512552fe7
3 changed files with 43 additions and 8 deletions
|
|
@ -191,7 +191,8 @@ public partial class FileDownloadManager : DisposableMediatorSubscriberBase
|
|||
|
||||
foreach (var file in fileGroup)
|
||||
{
|
||||
var tempPath = _fileDbManager.GetCacheFilePath(file.Hash, isTemporaryFile: true);
|
||||
var ext = fileReplacement.First(f => string.Equals(f.Hash, file.Hash, StringComparison.OrdinalIgnoreCase)).GamePaths.First().Split(".").Last();
|
||||
var tempPath = _fileDbManager.GetCacheFilePath(file.Hash, ext, isTemporaryFile: true);
|
||||
Progress<long> progress = new((bytesDownloaded) =>
|
||||
{
|
||||
try
|
||||
|
|
@ -235,7 +236,7 @@ public partial class FileDownloadManager : DisposableMediatorSubscriberBase
|
|||
var tempFileData = await File.ReadAllBytesAsync(tempPath, token).ConfigureAwait(false);
|
||||
var extractedFile = LZ4Codec.Unwrap(tempFileData);
|
||||
File.Delete(tempPath);
|
||||
var filePath = _fileDbManager.GetCacheFilePath(file.Hash, isTemporaryFile: false);
|
||||
var filePath = _fileDbManager.GetCacheFilePath(file.Hash, ext, isTemporaryFile: false);
|
||||
await File.WriteAllBytesAsync(filePath, extractedFile, token).ConfigureAwait(false);
|
||||
var fi = new FileInfo(filePath);
|
||||
Func<DateTime> RandomDayInThePast()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue