diff --git a/Tranga/LibraryConnectors/Kavita.cs b/Tranga/LibraryConnectors/Kavita.cs index 4dfb02b..a9d2fa9 100644 --- a/Tranga/LibraryConnectors/Kavita.cs +++ b/Tranga/LibraryConnectors/Kavita.cs @@ -83,7 +83,7 @@ public class Kavita : LibraryConnector private IEnumerable GetLibraries() { Log("Getting libraries."); - Stream data = NetClient.MakeRequest($"{baseUrl}/api/Library", "Bearer", auth, logger); + Stream data = NetClient.MakeRequest($"{baseUrl}/api/Library/libraries", "Bearer", auth, logger); if (data == Stream.Null) { Log("No libraries returned"); @@ -96,11 +96,13 @@ public class Kavita : LibraryConnector return Array.Empty(); } - HashSet ret = new(); + List ret = new(); foreach (JsonNode? jsonNode in result) { - var jObject = (JsonObject?)jsonNode; + JsonObject? jObject = (JsonObject?)jsonNode; + if(jObject is null) + continue; int libraryId = jObject!["id"]!.GetValue(); string libraryName = jObject["name"]!.GetValue(); ret.Add(new KavitaLibrary(libraryId, libraryName));