mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-01-30 16:37:29 +01:00
Derived Constructor
This commit is contained in:
parent
f280c01802
commit
088d1c4647
@ -26,20 +26,24 @@ public class TaskManager
|
||||
/// <param name="imageCachePath">Path to the cover-image cache</param>
|
||||
/// <param name="libraryManagers"></param>
|
||||
/// <param name="logger"></param>
|
||||
public TaskManager(string downloadFolderPath, string workingDirectory, string imageCachePath, HashSet<LibraryManager> libraryManagers, Logger? logger = null)
|
||||
public TaskManager(string downloadFolderPath, string workingDirectory, string imageCachePath, HashSet<LibraryManager> libraryManagers, Logger? logger = null) : this(new TrangaSettings(downloadFolderPath, workingDirectory, libraryManagers), logger)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TaskManager(TrangaSettings settings, Logger? logger = null)
|
||||
{
|
||||
this.logger = logger;
|
||||
|
||||
this.settings = new TrangaSettings(downloadFolderPath, workingDirectory, libraryManagers);
|
||||
ExportDataAndSettings();
|
||||
|
||||
this._connectors = new Connector[]
|
||||
{
|
||||
new MangaDex(downloadFolderPath, imageCachePath, logger),
|
||||
new Manganato(downloadFolderPath, imageCachePath, logger),
|
||||
new Mangasee(downloadFolderPath, imageCachePath, logger)
|
||||
new MangaDex(settings.downloadLocation, settings.coverImageCache, logger),
|
||||
new Manganato(settings.downloadLocation, settings.coverImageCache, logger),
|
||||
new Mangasee(settings.downloadLocation, settings.coverImageCache, logger)
|
||||
};
|
||||
|
||||
this.settings = settings;
|
||||
ImportData();
|
||||
ExportDataAndSettings();
|
||||
Thread taskChecker = new(TaskCheckerThread);
|
||||
taskChecker.Start();
|
||||
}
|
||||
@ -61,23 +65,6 @@ public class TaskManager
|
||||
ExportDataAndSettings();
|
||||
}
|
||||
|
||||
public TaskManager(TrangaSettings settings, Logger? logger = null)
|
||||
{
|
||||
this.logger = logger;
|
||||
this._connectors = new Connector[]
|
||||
{
|
||||
new MangaDex(settings.downloadLocation, settings.coverImageCache, logger),
|
||||
new Manganato(settings.downloadLocation, settings.coverImageCache, logger),
|
||||
new Mangasee(settings.downloadLocation, settings.coverImageCache, logger)
|
||||
};
|
||||
|
||||
this.settings = settings;
|
||||
ImportData();
|
||||
ExportDataAndSettings();
|
||||
Thread taskChecker = new(TaskCheckerThread);
|
||||
taskChecker.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs continuously until shutdown.
|
||||
/// Checks if tasks have to be executed (time elapsed)
|
||||
|
Loading…
x
Reference in New Issue
Block a user