potential mcdf fixes
This commit is contained in:
@@ -33,18 +33,23 @@ public record MareCharaFileData
|
||||
|
||||
if (dto.FileReplacements.TryGetValue(ObjectKind.Player, out var fileReplacements))
|
||||
{
|
||||
foreach (var file in fileReplacements)
|
||||
var grouped = fileReplacements.GroupBy(f => f.Hash, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
foreach (var file in grouped)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(file.FileSwapPath))
|
||||
if (string.IsNullOrEmpty(file.Key))
|
||||
{
|
||||
FileSwaps.Add(new FileSwap(file.GamePaths, file.FileSwapPath));
|
||||
foreach (var item in file)
|
||||
{
|
||||
FileSwaps.Add(new FileSwap(item.GamePaths, item.FileSwapPath));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var filePath = manager.GetFileCacheByHash(file.Hash)?.ResolvedFilepath;
|
||||
var filePath = manager.GetFileCacheByHash(file.First().Hash)?.ResolvedFilepath;
|
||||
if (filePath != null)
|
||||
{
|
||||
Files.Add(new FileData(file.GamePaths, new FileInfo(filePath).Length));
|
||||
Files.Add(new FileData(file.SelectMany(f => f.GamePaths), (int)new FileInfo(filePath).Length, file.First().Hash));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,5 +68,5 @@ public record MareCharaFileData
|
||||
|
||||
public record FileSwap(IEnumerable<string> GamePaths, string FileSwapPath);
|
||||
|
||||
public record FileData(IEnumerable<string> GamePaths, long Length);
|
||||
public record FileData(IEnumerable<string> GamePaths, int Length, string Hash);
|
||||
}
|
||||
Reference in New Issue
Block a user