mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-07-06 02:44:17 +02:00
Added taskId to trangaTask and parentTaskId to DownloadChapterTask as unique identifier to attach ChildTasks to ParentTask on deserialization.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Globalization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@ -20,6 +21,7 @@ public abstract class TrangaTask
|
||||
public TimeSpan reoccurrence { get; }
|
||||
public DateTime lastExecuted { get; set; }
|
||||
public Task task { get; }
|
||||
public string taskId { get; set; }
|
||||
[Newtonsoft.Json.JsonIgnore]public ExecutionState state { get; set; }
|
||||
[Newtonsoft.Json.JsonIgnore]public double progress { get; protected set; }
|
||||
[Newtonsoft.Json.JsonIgnore]public DateTime nextExecution => lastExecuted.Add(reoccurrence);
|
||||
@ -50,6 +52,7 @@ public abstract class TrangaTask
|
||||
this.progress = 0f;
|
||||
this.executionStarted = DateTime.Now;
|
||||
this.lastChange = DateTime.MaxValue;
|
||||
this.taskId = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(this.executionStarted.ToString(CultureInfo.InvariantCulture)));
|
||||
}
|
||||
|
||||
public double IncrementProgress(double amount)
|
||||
|
Reference in New Issue
Block a user