diff --git a/MareSynchronos/PlayerData/Handlers/PairHandler.cs b/MareSynchronos/PlayerData/Handlers/PairHandler.cs index f222b93..8a346e2 100644 --- a/MareSynchronos/PlayerData/Handlers/PairHandler.cs +++ b/MareSynchronos/PlayerData/Handlers/PairHandler.cs @@ -580,7 +580,7 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase private List TryCalculateModdedDictionary(Guid applicationBase, CharacterData charaData, out Dictionary moddedDictionary, CancellationToken token) { Stopwatch st = Stopwatch.StartNew(); - List missingFiles = new(); + ConcurrentBag missingFiles = new(); moddedDictionary = new Dictionary(StringComparer.Ordinal); ConcurrentDictionary outputDict = new(StringComparer.Ordinal); bool hasMigrationChanges = false; @@ -634,6 +634,6 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase if (hasMigrationChanges) _fileDbManager.WriteOutFullCsv(); st.Stop(); Logger.LogDebug("[BASE-{appBase}] ModdedPaths calculated in {time}ms, missing files: {count}, total files: {total}", applicationBase, st.ElapsedMilliseconds, missingFiles.Count, moddedDictionary.Keys.Count); - return missingFiles; + return missingFiles.ToList(); } } \ No newline at end of file diff --git a/MareSynchronos/WebAPI/Files/FileDownloadManager.cs b/MareSynchronos/WebAPI/Files/FileDownloadManager.cs index d1d29cf..ab72fdc 100644 --- a/MareSynchronos/WebAPI/Files/FileDownloadManager.cs +++ b/MareSynchronos/WebAPI/Files/FileDownloadManager.cs @@ -188,7 +188,7 @@ public partial class FileDownloadManager : DisposableMediatorSubscriberBase Logger.LogDebug("Download start: {id}", gameObjectHandler.Name); List downloadFileInfoFromService = new(); - downloadFileInfoFromService.AddRange(await FilesGetSizes(fileReplacement.Select(f => f.Hash).ToList(), ct).ConfigureAwait(false)); + downloadFileInfoFromService.AddRange(await FilesGetSizes(fileReplacement.Select(f => f.Hash).Distinct(StringComparer.Ordinal).ToList(), ct).ConfigureAwait(false)); Logger.LogDebug("Files with size 0 or less: {files}", string.Join(", ", downloadFileInfoFromService.Where(f => f.Size <= 0).Select(f => f.Hash)));