diff --git a/Tranga/LibraryManager.cs b/Tranga/LibraryManager.cs
index 2c917e4..f8eb76b 100644
--- a/Tranga/LibraryManager.cs
+++ b/Tranga/LibraryManager.cs
@@ -15,7 +15,7 @@ public abstract class LibraryManager
Kavita = 1
}
- public LibraryType libraryType;
+ public LibraryType libraryType { get; }
public string baseUrl { get; }
protected string auth { get; } //Base64 encoded, if you use your password everywhere, you have problems
protected Logger? logger;
@@ -23,11 +23,12 @@ public abstract class LibraryManager
/// Base-URL of Komga instance, no trailing slashes(/)
/// Base64 string of username and password (username):(password)
///
- protected LibraryManager(string baseUrl, string auth, Logger? logger)
+ protected LibraryManager(string baseUrl, string auth, Logger? logger, LibraryType libraryType)
{
this.baseUrl = baseUrl;
this.auth = auth;
this.logger = logger;
+ this.libraryType = libraryType;
}
public abstract void UpdateLibrary();
diff --git a/Tranga/LibraryManagers/Kavita.cs b/Tranga/LibraryManagers/Kavita.cs
index 647d20c..c266e9e 100644
--- a/Tranga/LibraryManagers/Kavita.cs
+++ b/Tranga/LibraryManagers/Kavita.cs
@@ -6,9 +6,8 @@ namespace Tranga.LibraryManagers;
public class Kavita : LibraryManager
{
- public Kavita(string baseUrl, string apiKey, Logger? logger) : base(baseUrl, apiKey, logger)
+ public Kavita(string baseUrl, string apiKey, Logger? logger) : base(baseUrl, apiKey, logger, LibraryType.Kavita)
{
- this.libraryType = LibraryType.Kavita;
}
public override void UpdateLibrary()
diff --git a/Tranga/LibraryManagers/Komga.cs b/Tranga/LibraryManagers/Komga.cs
index 656d5b5..39586c1 100644
--- a/Tranga/LibraryManagers/Komga.cs
+++ b/Tranga/LibraryManagers/Komga.cs
@@ -12,15 +12,13 @@ namespace Tranga.LibraryManagers;
public class Komga : LibraryManager
{
public Komga(string baseUrl, string username, string password, Logger? logger)
- : base(baseUrl, Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes($"{username}:{password}")), logger)
+ : base(baseUrl, Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes($"{username}:{password}")), logger, LibraryType.Komga)
{
- this.libraryType = LibraryType.Komga;
}
[JsonConstructor]
- public Komga(string baseUrl, string auth, Logger? logger) : base(baseUrl, auth, logger)
+ public Komga(string baseUrl, string auth, Logger? logger) : base(baseUrl, auth, logger, LibraryType.Komga)
{
- this.libraryType = LibraryType.Komga;
}
public override void UpdateLibrary()