Also delete downloadChapterTask when delete download new chapter tasks

This commit is contained in:
glax 2023-06-05 21:16:04 +02:00
parent e14683d21a
commit 437136804d

View File

@ -223,10 +223,16 @@ public class TaskManager
if (connectorName is null || publicationId is null) if (connectorName is null || publicationId is null)
logger?.WriteLine(this.GetType().ToString(), "connectorName and publication can not be null"); logger?.WriteLine(this.GetType().ToString(), "connectorName and publication can not be null");
else else
{
_allTasks.RemoveWhere(mTask => _allTasks.RemoveWhere(mTask =>
mTask.GetType() == typeof(DownloadNewChaptersTask) && mTask.GetType() == typeof(DownloadNewChaptersTask) &&
((DownloadNewChaptersTask)mTask).publication.internalId == publicationId && ((DownloadNewChaptersTask)mTask).publication.internalId == publicationId &&
((DownloadNewChaptersTask)mTask).connectorName == connectorName!); ((DownloadNewChaptersTask)mTask).connectorName == connectorName!);
_allTasks.RemoveWhere(mTask =>
mTask.GetType() == typeof(DownloadChapterTask) &&
((DownloadChapterTask)mTask).publication.internalId == publicationId &&
((DownloadChapterTask)mTask).connectorName == connectorName!);
}
break; break;
} }
ExportDataAndSettings(); ExportDataAndSettings();