fixes 11
This commit is contained in:
parent
bb6a0ad0d4
commit
79dc44d707
@ -244,7 +244,6 @@ public static class Tranga_Cli
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
int selectedTaskIndex = Convert.ToInt32(selectedTask);
|
int selectedTaskIndex = Convert.ToInt32(selectedTask);
|
||||||
logger.WriteLine("Tranga_CLI", "Sending Task to TaskManager");
|
|
||||||
return tasks[selectedTaskIndex];
|
return tasks[selectedTaskIndex];
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -188,16 +188,23 @@ public class TaskManager
|
|||||||
if (task == TrangaTask.Task.UpdateKomgaLibrary)
|
if (task == TrangaTask.Task.UpdateKomgaLibrary)
|
||||||
{
|
{
|
||||||
_allTasks.RemoveWhere(uTask => uTask.task == TrangaTask.Task.UpdateKomgaLibrary);
|
_allTasks.RemoveWhere(uTask => uTask.task == TrangaTask.Task.UpdateKomgaLibrary);
|
||||||
logger?.WriteLine(this.GetType().ToString(), $"Removed Task {task}");
|
logger?.WriteLine(this.GetType().ToString(), $"Removed Task {task} from all Tasks.");
|
||||||
}
|
}
|
||||||
else if (connectorName is null)
|
else if (connectorName is null)
|
||||||
throw new ArgumentException($"connectorName can not be null for Task {task}");
|
throw new ArgumentException($"connectorName can not be null for Task {task}");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
foreach (List<TrangaTask> taskQueue in this._taskQueue.Values)
|
||||||
|
if(taskQueue.RemoveAll(trangaTask =>
|
||||||
|
trangaTask.task == task && trangaTask.connectorName == connectorName &&
|
||||||
|
trangaTask.publication?.internalId == publication?.internalId) > 0)
|
||||||
|
logger?.WriteLine(this.GetType().ToString(), $"Removed Task {task} {publication?.sortName} {publication?.internalId} from Queue.");
|
||||||
|
else
|
||||||
|
logger?.WriteLine(this.GetType().ToString(), $"Task {task} {publication?.sortName} {publication?.internalId} was not in Queue.");
|
||||||
if(_allTasks.RemoveWhere(trangaTask =>
|
if(_allTasks.RemoveWhere(trangaTask =>
|
||||||
trangaTask.task == task && trangaTask.connectorName == connectorName &&
|
trangaTask.task == task && trangaTask.connectorName == connectorName &&
|
||||||
trangaTask.publication?.internalId == publication?.internalId) > 0)
|
trangaTask.publication?.internalId == publication?.internalId) > 0)
|
||||||
logger?.WriteLine(this.GetType().ToString(), $"Removed Task {task} {publication?.sortName} {publication?.internalId}.");
|
logger?.WriteLine(this.GetType().ToString(), $"Removed Task {task} {publication?.sortName} {publication?.internalId} from all Tasks.");
|
||||||
else
|
else
|
||||||
logger?.WriteLine(this.GetType().ToString(), $"No Task {task} {publication?.sortName} {publication?.internalId} could be found.");
|
logger?.WriteLine(this.GetType().ToString(), $"No Task {task} {publication?.sortName} {publication?.internalId} could be found.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user