Changed progress type from float to double
This commit is contained in:
parent
41929e0c72
commit
6eaba07801
@ -252,7 +252,7 @@ public abstract class Connector
|
||||
string extension = split[^1];
|
||||
logger?.WriteLine("Connector", $"Downloading Image {chapter + 1:000}/{imageUrls.Length:000} {parentTask.publication.sortName} {parentTask.publication.internalId} Vol.{parentTask.chapter.volumeNumber} Ch.{parentTask.chapter.chapterNumber} {parentTask.progress:P2}");
|
||||
DownloadImage(imageUrl, Path.Join(tempFolder, $"{chapter++}.{extension}"), requestType, referrer);
|
||||
parentTask.IncrementProgress(1f / imageUrls.Length);
|
||||
parentTask.IncrementProgress(1.0 / imageUrls.Length);
|
||||
if (cancellationToken?.IsCancellationRequested??false)
|
||||
return;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public abstract class TrangaTask
|
||||
public DateTime lastExecuted { get; set; }
|
||||
public Task task { get; }
|
||||
[Newtonsoft.Json.JsonIgnore]public ExecutionState state { get; set; }
|
||||
[Newtonsoft.Json.JsonIgnore]public float progress { get; protected set; }
|
||||
[Newtonsoft.Json.JsonIgnore]public double progress { get; protected set; }
|
||||
[Newtonsoft.Json.JsonIgnore]public DateTime nextExecution => lastExecuted.Add(reoccurrence);
|
||||
[Newtonsoft.Json.JsonIgnore]public DateTime executionStarted { get; private set; }
|
||||
|
||||
@ -52,14 +52,14 @@ public abstract class TrangaTask
|
||||
this.lastChange = DateTime.MaxValue;
|
||||
}
|
||||
|
||||
public float IncrementProgress(float amount)
|
||||
public double IncrementProgress(double amount)
|
||||
{
|
||||
this.progress += amount;
|
||||
this.lastChange = DateTime.Now;
|
||||
return this.progress;
|
||||
}
|
||||
|
||||
public float DecrementProgress(float amount)
|
||||
public double DecrementProgress(double amount)
|
||||
{
|
||||
this.progress -= amount;
|
||||
this.lastChange = DateTime.Now;
|
||||
|
Loading…
Reference in New Issue
Block a user