From 3aa299e48acf12c129ca3a9885fd531c6fd587d5 Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 31 Jul 2023 01:28:32 +0200 Subject: [PATCH] deserialization of enum --- Tranga/Migrator.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tranga/Migrator.cs b/Tranga/Migrator.cs index 3ebbf96..b15f1ff 100644 --- a/Tranga/Migrator.cs +++ b/Tranga/Migrator.cs @@ -52,8 +52,8 @@ public static class Migrator node["downloadLocation"]!.GetValue(), node["workingDirectory"]!.GetValue()); JsonArray libraryManagers = node["libraryManagers"]!.AsArray(); - JsonNode? komgaNode = libraryManagers.FirstOrDefault(lm => lm["libraryType"].GetValue() == LibraryManager.LibraryType.Komga); - JsonNode? kavitaNode = libraryManagers.FirstOrDefault(lm => lm["libraryType"].GetValue() == LibraryManager.LibraryType.Kavita); + JsonNode? komgaNode = libraryManagers.FirstOrDefault(lm => lm["libraryType"].GetValue() == (byte)LibraryManager.LibraryType.Komga); + JsonNode? kavitaNode = libraryManagers.FirstOrDefault(lm => lm["libraryType"].GetValue() == (byte)LibraryManager.LibraryType.Kavita); HashSet lms = new(); if (komgaNode is not null) lms.Add(new Komga(komgaNode["baseUrl"]!.GetValue(), komgaNode["auth"]!.GetValue(), null)); @@ -62,9 +62,9 @@ public static class Migrator JsonArray notificationManagers = node["libraryManagers"]!.AsArray(); JsonNode? gotifyNode = notificationManagers.FirstOrDefault(nm => - nm["notificationManagerType"].GetValue() == NotificationManager.NotificationManagerType.Gotify); + nm["notificationManagerType"].GetValue() == (byte)NotificationManager.NotificationManagerType.Gotify); JsonNode? lunaSeaNode = notificationManagers.FirstOrDefault(nm => - nm["notificationManagerType"].GetValue() == NotificationManager.NotificationManagerType.LunaSea); + nm["notificationManagerType"].GetValue() == (byte)NotificationManager.NotificationManagerType.LunaSea); HashSet nms = new(); if (gotifyNode is not null) nms.Add(new Gotify(gotifyNode["endpoint"]!.GetValue(), gotifyNode["appToken"]!.GetValue()));