From b15e0320386299a6f780f338522a6f8088d79b00 Mon Sep 17 00:00:00 2001 From: glax <--local> Date: Thu, 18 May 2023 16:40:11 +0200 Subject: [PATCH] Add field downloadLocation to Connector to save archives. --- Tranga-CLI/Program.cs | 2 +- Tranga/Connector.cs | 1 + Tranga/Connectors/MangaDex.cs | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Tranga-CLI/Program.cs b/Tranga-CLI/Program.cs index 4f4ea3e..fc89b26 100644 --- a/Tranga-CLI/Program.cs +++ b/Tranga-CLI/Program.cs @@ -6,7 +6,7 @@ public class Program { public static void Main(string[] args) { - MangaDex mangaDexConnector = new MangaDex(); + MangaDex mangaDexConnector = new MangaDex("D:"); Publication[] publications = mangaDexConnector.GetPublications(); Console.ReadKey(); } diff --git a/Tranga/Connector.cs b/Tranga/Connector.cs index 0291f07..b04bd28 100644 --- a/Tranga/Connector.cs +++ b/Tranga/Connector.cs @@ -4,6 +4,7 @@ namespace Tranga; public abstract class Connector { + internal abstract string downloadLocation { get; } public abstract string name { get; } public abstract Publication[] GetPublications(); public abstract Chapter[] GetChapters(Publication publication); diff --git a/Tranga/Connectors/MangaDex.cs b/Tranga/Connectors/MangaDex.cs index aa16fa7..6bf293a 100644 --- a/Tranga/Connectors/MangaDex.cs +++ b/Tranga/Connectors/MangaDex.cs @@ -5,12 +5,14 @@ namespace Tranga.Connectors; public class MangaDex : Connector { + internal override string downloadLocation { get; } public override string name { get; } private DownloadClient _downloadClient = new (); - public MangaDex() + public MangaDex(string downloadLocation) { name = "MangaDex.org"; + this.downloadLocation = downloadLocation; } public override Publication[] GetPublications()