From 72bd1c56a87837d210d515e4849bbf68b46deb32 Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 20 May 2023 14:18:03 +0200 Subject: [PATCH] Added Method GetConnector to TaskManager that returns Connector with given Name. Removed Method NewKomga unused --- Tranga/TaskManager.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Tranga/TaskManager.cs b/Tranga/TaskManager.cs index b0018e3..06128b6 100644 --- a/Tranga/TaskManager.cs +++ b/Tranga/TaskManager.cs @@ -157,10 +157,12 @@ public class TaskManager return this._chapterCollection.Keys.ToArray(); } - public void NewKomga(Komga? pKomga) + public Connector GetConnector(string connectorName) { - this.komga = pKomga; - this.ExportData(Directory.GetCurrentDirectory()); + Connector? ret = this._connectors.FirstOrDefault(connector => connector.name == connectorName); + if (ret is null) + throw new Exception($"Connector {connectorName} is not an available Connector."); + return (Connector)ret!; } ///