Compare commits
No commits in common. "a4c9168551e0d1572819607c25a117e13a0fb6a1" and "b2b4256972488d76dfb4afbdfcbfe4fc89af0caa" have entirely different histories.
a4c9168551
...
b2b4256972
@ -42,7 +42,7 @@ public abstract class TrangaTask
|
||||
this.task = task;
|
||||
this.executionStarted = DateTime.Now;
|
||||
this.lastChange = DateTime.MaxValue;
|
||||
this.taskId = Convert.ToBase64String(BitConverter.GetBytes(new Random().Next()));
|
||||
this.taskId = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(this.executionStarted.ToString(CultureInfo.InvariantCulture)));
|
||||
this.childTasks = new();
|
||||
this.parentTask = parentTask;
|
||||
this.parentTaskId = parentTask?.taskId;
|
||||
@ -69,8 +69,6 @@ public abstract class TrangaTask
|
||||
this.executionStarted = DateTime.Now;
|
||||
this.lastChange = DateTime.Now;
|
||||
ExecuteTask(taskManager, logger, cancellationToken);
|
||||
while(this.childTasks.Any(childTask => childTask.state is ExecutionState.Running or ExecutionState.Enqueued))
|
||||
Thread.Sleep(1000);
|
||||
this.lastExecuted = DateTime.Now;
|
||||
this.state = ExecutionState.Waiting;
|
||||
logger?.WriteLine(this.GetType().ToString(), $"Finished Executing Task {this}");
|
||||
|
@ -391,11 +391,11 @@ function ShowTasksQueue(){
|
||||
json.forEach(task => {
|
||||
if(task.task == 2 || task.task == 4) {
|
||||
downloadTasksOutput.appendChild(CreateProgressChild(task));
|
||||
document.querySelector(`#progress${GetValidSelector(task.taskId)}`).value = task.progress;
|
||||
document.querySelector(`#progress${task.taskId.replaceAll('=', '')}`).value = task.progress;
|
||||
var finishedHours = task.executionApproximatelyRemaining.split(':')[0];
|
||||
var finishedMinutes = task.executionApproximatelyRemaining.split(':')[1];
|
||||
var finishedSeconds = task.executionApproximatelyRemaining.split(':')[2].split('.')[0];
|
||||
document.querySelector(`#progressStr${GetValidSelector(task.taskId)}`).innerText = `${finishedHours}:${finishedMinutes}:${finishedSeconds}`;
|
||||
document.querySelector(`#progressStr${task.taskId.replaceAll('=', '')}`).innerText = `${finishedHours}:${finishedMinutes}:${finishedSeconds}`;
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -423,13 +423,13 @@ function CreateProgressChild(task){
|
||||
|
||||
|
||||
var progress = document.createElement("progress");
|
||||
progress.id = `progress${GetValidSelector(task.taskId)}`;
|
||||
progress.id = `progress${task.taskId.replaceAll('=','')}`;
|
||||
child.appendChild(progress);
|
||||
|
||||
var progressStr = document.createElement("span");
|
||||
progressStr.innerText = " \t∞";
|
||||
progressStr.className = "progressStr";
|
||||
progressStr.id = `progressStr${GetValidSelector(task.taskId)}`;
|
||||
progressStr.id = `progressStr${task.taskId.replaceAll('=','')}`;
|
||||
child.appendChild(progressStr);
|
||||
|
||||
if(task.chapter != undefined){
|
||||
@ -513,17 +513,12 @@ setInterval(() => {
|
||||
GetRunningTasks().then((json) => {
|
||||
json.forEach(task => {
|
||||
if(task.task == 2 || task.task == 4){
|
||||
document.querySelector(`#progress${GetValidSelector(task.taskId)}`).value = task.progress;
|
||||
document.querySelector(`#progress${task.taskId.replaceAll('=','')}`).value = task.progress;
|
||||
var finishedHours = task.executionApproximatelyRemaining.split(':')[0];
|
||||
var finishedMinutes = task.executionApproximatelyRemaining.split(':')[1];
|
||||
var finishedSeconds = task.executionApproximatelyRemaining.split(':')[2].split('.')[0];
|
||||
document.querySelector(`#progressStr${GetValidSelector(task.taskId)}`).innerText = `${finishedHours}:${finishedMinutes}:${finishedSeconds}`;
|
||||
document.querySelector(`#progressStr${task.taskId.replaceAll('=','')}`).innerText = `${finishedHours}:${finishedMinutes}:${finishedSeconds}`;
|
||||
}
|
||||
});
|
||||
});
|
||||
},500);
|
||||
|
||||
function GetValidSelector(str){
|
||||
var clean = [...str.matchAll(/[a-zA-Z0-9]*-*_*/g)];
|
||||
return clean.join('');
|
||||
}
|
||||
},500);
|
Loading…
Reference in New Issue
Block a user