2
0

DownloadChapterTask sets execution of parentTask

This commit is contained in:
glax 2023-06-10 15:04:37 +02:00
parent 4fcaca1a6e
commit 41929e0c72

View File

@ -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);
} }