Compare commits

...

2 Commits

Author SHA1 Message Date
e14683d21a Merge remote-tracking branch 'origin/master'
# Conflicts:
#	Tranga/TaskManager.cs
2023-06-05 21:11:10 +02:00
5ae02ee0ed Fix Bug where all tasks would be deleted... 2023-06-05 21:10:42 +02:00

View File

@ -207,7 +207,7 @@ public class TaskManager
/// </summary> /// </summary>
/// <param name="task">TrangaTask.Task type</param> /// <param name="task">TrangaTask.Task type</param>
/// <param name="connectorName">Name of Connector that was used</param> /// <param name="connectorName">Name of Connector that was used</param>
/// <param name="publication">Publication that was used</param> /// <param name="publicationId">Publication that was used</param>
public void DeleteTask(TrangaTask.Task task, string? connectorName, string? publicationId) public void DeleteTask(TrangaTask.Task task, string? connectorName, string? publicationId)
{ {
logger?.WriteLine(this.GetType().ToString(), $"Removing Task {task} {publicationId}"); logger?.WriteLine(this.GetType().ToString(), $"Removing Task {task} {publicationId}");
@ -220,13 +220,13 @@ public class TaskManager
_allTasks.RemoveWhere(trangaTask => trangaTask.task is TrangaTask.Task.UpdateLibraries); _allTasks.RemoveWhere(trangaTask => trangaTask.task is TrangaTask.Task.UpdateLibraries);
break; break;
case TrangaTask.Task.DownloadNewChapters: case TrangaTask.Task.DownloadNewChapters:
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!);
break; break;
} }
ExportDataAndSettings(); ExportDataAndSettings();