From 636d17d2870e2bba38c18dce14074569faa1b6e0 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 21 May 2023 03:21:34 +0200 Subject: [PATCH] Only list tasks that are not already running when asking to execute now. --- Tranga-CLI/Tranga_Cli.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tranga-CLI/Tranga_Cli.cs b/Tranga-CLI/Tranga_Cli.cs index 08a2232..ea774c4 100644 --- a/Tranga-CLI/Tranga_Cli.cs +++ b/Tranga-CLI/Tranga_Cli.cs @@ -325,7 +325,7 @@ public static class Tranga_Cli private static void ExecuteTaskNow(TaskManager taskManager, Logger logger) { logger.WriteLine("Tranga_CLI", "Menu: Executing Task"); - TrangaTask[] tasks = taskManager.GetAllTasks(); + TrangaTask[] tasks = taskManager.GetAllTasks().Where(nTask => nTask.state is not TrangaTask.ExecutionState.Running).ToArray(); TrangaTask? selectedTask = SelectTask(tasks, logger); if (selectedTask is null)