fix: Cleans up archiving and fixes wrong relative path used (#825)

This commit is contained in:
Kamron Batman 2021-10-09 14:36:46 -07:00 committed by GitHub
parent 507eba34a8
commit fe0abc4a8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View file

@ -314,7 +314,7 @@ namespace Server.Saves
foreach (var (rangeStart, sortedBackups) in items)
{
var backups = sortedBackups.Values;
if (backups.Count == 0)
if (backups.Count <= minimum)
{
continue;
}
@ -397,7 +397,9 @@ namespace Server.Saves
if (TryGetDate(name, out var date))
{
items.Add(date, item);
// Might give wrong results if there is a file that matches:
// Example: 2021-09-01, and 2021-09-01-00
items[date] = item;
}
}
@ -435,7 +437,6 @@ namespace Server.Saves
}
catch
{
logger.Warning($"Path was not in the correct date format: {value}");
date = DateTime.MinValue;
return false;
}