diff --git a/Tranga/Migrate.cs b/Tranga/Migrate.cs index 9eceeae..9ab7eee 100644 --- a/Tranga/Migrate.cs +++ b/Tranga/Migrate.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using Logging; +using Newtonsoft.Json; namespace Tranga; @@ -21,7 +22,11 @@ public static class Migrate private static void RemoveUpdateLibraryTask(TrangaSettings settings) { - List tasks = JsonConvert.DeserializeObject>(settings.tasksFilePath)!; + if (!File.Exists(settings.tasksFilePath)) + return; + + string tasksJsonString = File.ReadAllText(settings.tasksFilePath); + List tasks = JsonConvert.DeserializeObject>(tasksJsonString, new JsonSerializerSettings { Converters = { new TrangaTask.TrangaTaskJsonConverter() } })!; tasks.RemoveAll(t => t.task == TrangaTask.Task.UpdateLibraries); } } \ No newline at end of file