removed unnecessary cast

This commit is contained in:
glax 2023-06-07 00:24:58 +02:00
parent 6a304bb330
commit 1f3ac41b30
2 changed files with 3 additions and 4 deletions

View File

@ -13,7 +13,7 @@ namespace Tranga;
public class TaskManager
{
public Dictionary<Publication, List<Chapter>> chapterCollection = new();
private HashSet<TrangaTask> _allTasks = new HashSet<TrangaTask>();
private HashSet<TrangaTask> _allTasks = new();
private bool _continueRunning = true;
private readonly Connector[] _connectors;
public TrangaSettings settings { get; }

View File

@ -9,7 +9,7 @@ public class DownloadChapterTask : TrangaTask
public Publication publication { get; }
public string language { get; }
public Chapter chapter { get; }
[JsonIgnore]private DownloadNewChaptersTask? parentTask { get; init; }
[JsonIgnore]public DownloadNewChaptersTask? parentTask { get; init; }
public DownloadChapterTask(Task task, string connectorName, Publication publication, Chapter chapter, string language = "en", DownloadNewChaptersTask? parentTask = null) : base(task, TimeSpan.Zero)
{
@ -22,9 +22,8 @@ public class DownloadChapterTask : TrangaTask
protected override void ExecuteTask(TaskManager taskManager, Logger? logger)
{
Publication pub = (Publication)this.publication!;
Connector connector = taskManager.GetConnector(this.connectorName);
connector.DownloadChapter(pub, this.chapter, this);
connector.DownloadChapter(this.publication, this.chapter, this);
taskManager.DeleteTask(this);
}