Fix wrong deserialization
This commit is contained in:
parent
18323f9f51
commit
77eec0f696
@ -1,4 +1,5 @@
|
|||||||
using Newtonsoft.Json;
|
using Logging;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Tranga;
|
namespace Tranga;
|
||||||
|
|
||||||
@ -21,7 +22,11 @@ public static class Migrate
|
|||||||
|
|
||||||
private static void RemoveUpdateLibraryTask(TrangaSettings settings)
|
private static void RemoveUpdateLibraryTask(TrangaSettings settings)
|
||||||
{
|
{
|
||||||
List<TrangaTask> tasks = JsonConvert.DeserializeObject<List<TrangaTask>>(settings.tasksFilePath)!;
|
if (!File.Exists(settings.tasksFilePath))
|
||||||
|
return;
|
||||||
|
|
||||||
|
string tasksJsonString = File.ReadAllText(settings.tasksFilePath);
|
||||||
|
List<TrangaTask> tasks = JsonConvert.DeserializeObject<List<TrangaTask>>(tasksJsonString, new JsonSerializerSettings { Converters = { new TrangaTask.TrangaTaskJsonConverter() } })!;
|
||||||
tasks.RemoveAll(t => t.task == TrangaTask.Task.UpdateLibraries);
|
tasks.RemoveAll(t => t.task == TrangaTask.Task.UpdateLibraries);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user