mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-07-06 02:44:17 +02:00
Renamed DownloadNewChaptersTask to MonitorPublicationTask
Added TrangaTask.Clone() method Rewrote TrangaTask.progress for the billionth+1 time. Removed Increment and DecrementProgress methods Removed TrangaTask.ReplaceFailedChildTask method Changed return type of TrangaTask.ExecuteTask to bool, signifying success. Added Failed Execution state to TrangaTask Replaced taskManager failed-task logic Removed TaskManager bulky AddTask and DeleteTask methods Removed TaskManager bulky Constructor
This commit is contained in:
@ -4,16 +4,26 @@ namespace Tranga.TrangaTasks;
|
||||
|
||||
public class UpdateLibrariesTask : TrangaTask
|
||||
{
|
||||
public UpdateLibrariesTask(Task task, TimeSpan reoccurrence) : base(task, reoccurrence)
|
||||
public UpdateLibrariesTask(TimeSpan reoccurrence) : base(Task.UpdateLibraries, reoccurrence)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void ExecuteTask(TaskManager taskManager, Logger? logger, CancellationToken? cancellationToken = null)
|
||||
protected override bool ExecuteTask(TaskManager taskManager, Logger? logger, CancellationToken? cancellationToken = null)
|
||||
{
|
||||
if (cancellationToken?.IsCancellationRequested??false)
|
||||
return;
|
||||
return false;
|
||||
foreach(LibraryManager lm in taskManager.settings.libraryManagers)
|
||||
lm.UpdateLibrary();
|
||||
IncrementProgress(1);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override TrangaTask Clone()
|
||||
{
|
||||
return new UpdateLibrariesTask(this.reoccurrence);
|
||||
}
|
||||
|
||||
protected override double GetProgress()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user