Add automatic restore from backup for sort_order and active_collections for now.

This commit is contained in:
Ottermandias 2023-09-20 18:51:07 +02:00
parent 5a24d9155b
commit 40b6c6022a
4 changed files with 36 additions and 15 deletions

View file

@ -408,19 +408,15 @@ public class ActiveCollections : ISavable, IDisposable
public static bool Load(FilenameService fileNames, out JObject ret)
{
var file = fileNames.ActiveCollectionsFile;
if (File.Exists(file))
try
{
ret = JObject.Parse(File.ReadAllText(file));
return true;
}
catch (Exception e)
{
Penumbra.Log.Error($"Could not read active collections from file {file}:\n{e}");
}
var jObj = BackupService.GetJObjectForFile(fileNames, file);
if (jObj == null)
{
ret = new JObject();
return false;
}
ret = new JObject();
return false;
ret = jObj;
return true;
}
public string RedundancyCheck(CollectionType type, ActorIdentifier id)