2
0

Moved _chapterCollection initialization

This commit is contained in:
glax 2023-05-20 14:18:17 +02:00
parent 72bd1c56a8
commit fa44de0c8d

View File

@ -9,7 +9,7 @@ namespace Tranga;
/// </summary> /// </summary>
public class TaskManager public class TaskManager
{ {
private readonly Dictionary<Publication, List<Chapter>> _chapterCollection; private readonly Dictionary<Publication, List<Chapter>> _chapterCollection = new();
private readonly HashSet<TrangaTask> _allTasks; private readonly HashSet<TrangaTask> _allTasks;
private bool _continueRunning = true; private bool _continueRunning = true;
private readonly Connector[] _connectors; private readonly Connector[] _connectors;
@ -26,7 +26,6 @@ public class TaskManager
if (komgaBaseUrl != null && komgaUsername != null && komgaPassword != null) if (komgaBaseUrl != null && komgaUsername != null && komgaPassword != null)
this.komga = new Komga(komgaBaseUrl, komgaUsername, komgaPassword); this.komga = new Komga(komgaBaseUrl, komgaUsername, komgaPassword);
this._connectors = new Connector[]{ new MangaDex(folderPath) }; this._connectors = new Connector[]{ new MangaDex(folderPath) };
_chapterCollection = new();
_allTasks = new HashSet<TrangaTask>(); _allTasks = new HashSet<TrangaTask>();
Thread taskChecker = new(TaskCheckerThread); Thread taskChecker = new(TaskCheckerThread);
@ -36,7 +35,6 @@ public class TaskManager
public TaskManager(SettingsData settings) public TaskManager(SettingsData settings)
{ {
this._connectors = new Connector[]{ new MangaDex(settings.downloadLocation) }; this._connectors = new Connector[]{ new MangaDex(settings.downloadLocation) };
_chapterCollection = new();
this.downloadLocation = settings.downloadLocation; this.downloadLocation = settings.downloadLocation;
this.komga = settings.komga; this.komga = settings.komga;
_allTasks = settings.allTasks; _allTasks = settings.allTasks;