DownloadChapterTask sets execution of parentTask
This commit is contained in:
parent
4fcaca1a6e
commit
41929e0c72
@ -24,8 +24,12 @@ public class DownloadChapterTask : TrangaTask
|
|||||||
{
|
{
|
||||||
if (cancellationToken?.IsCancellationRequested??false)
|
if (cancellationToken?.IsCancellationRequested??false)
|
||||||
return;
|
return;
|
||||||
|
if(this.parentTask is not null)
|
||||||
|
this.parentTask.state = ExecutionState.Running;
|
||||||
Connector connector = taskManager.GetConnector(this.connectorName);
|
Connector connector = taskManager.GetConnector(this.connectorName);
|
||||||
connector.DownloadChapter(this.publication, this.chapter, this, cancellationToken);
|
connector.DownloadChapter(this.publication, this.chapter, this, cancellationToken);
|
||||||
|
if(this.parentTask is not null)
|
||||||
|
this.parentTask.state = ExecutionState.Waiting;
|
||||||
taskManager.DeleteTask(this);
|
taskManager.DeleteTask(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user