From f892db7ddafb787a5e230900a0d85888a3eb7ad0 Mon Sep 17 00:00:00 2001 From: glax Date: Wed, 31 May 2023 21:40:00 +0200 Subject: [PATCH] Switch Execution State to Running when executing --- Tranga/TrangaTask.cs | 4 ++++ Tranga/TrangaTasks/DownloadNewChaptersTask.cs | 1 + Tranga/TrangaTasks/UpdateKomgaLibraryTask.cs | 1 + 3 files changed, 6 insertions(+) diff --git a/Tranga/TrangaTask.cs b/Tranga/TrangaTask.cs index 25515c1..c8a6287 100644 --- a/Tranga/TrangaTask.cs +++ b/Tranga/TrangaTask.cs @@ -34,6 +34,10 @@ public abstract class TrangaTask this.language = language; } + /// + /// Set state to running + /// + /// public abstract void Execute(TaskManager taskManager); /// True if elapsed time since last execution is greater than set interval diff --git a/Tranga/TrangaTasks/DownloadNewChaptersTask.cs b/Tranga/TrangaTasks/DownloadNewChaptersTask.cs index dbc81b4..d37d7dd 100644 --- a/Tranga/TrangaTasks/DownloadNewChaptersTask.cs +++ b/Tranga/TrangaTasks/DownloadNewChaptersTask.cs @@ -8,6 +8,7 @@ public class DownloadNewChaptersTask : TrangaTask public override void Execute(TaskManager taskManager) { + this.state = ExecutionState.Running; Publication pub = (Publication)this.publication!; Connector connector = taskManager.GetConnector(this.connectorName); diff --git a/Tranga/TrangaTasks/UpdateKomgaLibraryTask.cs b/Tranga/TrangaTasks/UpdateKomgaLibraryTask.cs index 0a605f4..77c7d7f 100644 --- a/Tranga/TrangaTasks/UpdateKomgaLibraryTask.cs +++ b/Tranga/TrangaTasks/UpdateKomgaLibraryTask.cs @@ -8,6 +8,7 @@ public class UpdateKomgaLibraryTask : TrangaTask public override void Execute(TaskManager taskManager) { + this.state = ExecutionState.Running; if (taskManager.komga is null) return; Komga komga = taskManager.komga;