mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 16:57:22 +01:00
fixes an issue with transient data handling
This commit is contained in:
parent
ede62fabae
commit
9d4d919f0d
5 changed files with 38 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using MareSynchronos.API.Data.Enum;
|
||||
using MareSynchronos.MareConfiguration;
|
||||
using MareSynchronos.Mediator;
|
||||
using MareSynchronos.Models;
|
||||
using MareSynchronos.Utils;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
|
|
@ -83,11 +84,21 @@ public class TransientResourceManager : MediatorSubscriberBase, IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
public void CleanSemiTransientResources(ObjectKind objectKind)
|
||||
public void CleanSemiTransientResources(ObjectKind objectKind, List<FileReplacement>? fileReplacement = null)
|
||||
{
|
||||
if (SemiTransientResources.ContainsKey(objectKind))
|
||||
{
|
||||
SemiTransientResources[objectKind].Clear();
|
||||
if (fileReplacement == null)
|
||||
{
|
||||
SemiTransientResources[objectKind].Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var replacement in fileReplacement.Where(p => !p.HasFileReplacement).SelectMany(p => p.GamePaths).ToList())
|
||||
{
|
||||
|
||||
SemiTransientResources[objectKind].RemoveWhere(p => string.Equals(p, replacement, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue