Added Method GetConnector to TaskManager that returns Connector with given Name.

Removed Method NewKomga unused
This commit is contained in:
glax 2023-05-20 14:18:03 +02:00
parent 538cfec619
commit 72bd1c56a8

View File

@ -157,10 +157,12 @@ public class TaskManager
return this._chapterCollection.Keys.ToArray(); return this._chapterCollection.Keys.ToArray();
} }
public void NewKomga(Komga? pKomga) public Connector GetConnector(string connectorName)
{ {
this.komga = pKomga; Connector? ret = this._connectors.FirstOrDefault(connector => connector.name == connectorName);
this.ExportData(Directory.GetCurrentDirectory()); if (ret is null)
throw new Exception($"Connector {connectorName} is not an available Connector.");
return (Connector)ret!;
} }
/// <summary> /// <summary>