removed unnecessary cast
This commit is contained in:
parent
6a304bb330
commit
1f3ac41b30
@ -13,7 +13,7 @@ namespace Tranga;
|
|||||||
public class TaskManager
|
public class TaskManager
|
||||||
{
|
{
|
||||||
public Dictionary<Publication, List<Chapter>> chapterCollection = new();
|
public Dictionary<Publication, List<Chapter>> chapterCollection = new();
|
||||||
private HashSet<TrangaTask> _allTasks = new HashSet<TrangaTask>();
|
private HashSet<TrangaTask> _allTasks = new();
|
||||||
private bool _continueRunning = true;
|
private bool _continueRunning = true;
|
||||||
private readonly Connector[] _connectors;
|
private readonly Connector[] _connectors;
|
||||||
public TrangaSettings settings { get; }
|
public TrangaSettings settings { get; }
|
||||||
|
@ -9,7 +9,7 @@ public class DownloadChapterTask : TrangaTask
|
|||||||
public Publication publication { get; }
|
public Publication publication { get; }
|
||||||
public string language { get; }
|
public string language { get; }
|
||||||
public Chapter chapter { 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)
|
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)
|
protected override void ExecuteTask(TaskManager taskManager, Logger? logger)
|
||||||
{
|
{
|
||||||
Publication pub = (Publication)this.publication!;
|
|
||||||
Connector connector = taskManager.GetConnector(this.connectorName);
|
Connector connector = taskManager.GetConnector(this.connectorName);
|
||||||
connector.DownloadChapter(pub, this.chapter, this);
|
connector.DownloadChapter(this.publication, this.chapter, this);
|
||||||
taskManager.DeleteTask(this);
|
taskManager.DeleteTask(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user