mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 16:47:22 +01:00
several fixes for file cache handling, add account deletion
This commit is contained in:
parent
27208ed2a5
commit
8c9f816e6d
5 changed files with 98 additions and 5 deletions
|
|
@ -317,9 +317,15 @@ namespace MareSynchronos.Managers
|
|||
Logger.Debug("Found " + fileCachesToAdd.Count + " additions and " + fileCachesToDelete.Count + " deletions");
|
||||
try
|
||||
{
|
||||
db.FileCaches.RemoveRange(fileCachesToDelete);
|
||||
foreach (var deletion in fileCachesToDelete)
|
||||
{
|
||||
var entry = db.FileCaches.SingleOrDefault(f =>
|
||||
f.Hash == deletion.Hash && f.Filepath == deletion.Filepath);
|
||||
if (entry != null)
|
||||
db.FileCaches.Remove(entry);
|
||||
}
|
||||
db.FileCaches.AddRange(fileCachesToAdd);
|
||||
db.SaveChanges();
|
||||
await db.SaveChangesAsync(ct);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue