diff options
author | sr55 <[email protected]> | 2020-03-03 19:52:05 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2020-03-03 19:52:05 +0000 |
commit | 5605170542cbe1ae5131462912fb88e0fbfeca52 (patch) | |
tree | d10f75aa570bbe15783e09d1fd27295bd965eeca /win/CS/HandBrakeWPF/Services | |
parent | c28a2513ba3e8891206f7f912126c89c8041e958 (diff) |
WinGui: Handle in-progress jobs in queue import correctly. Reset them. Fixes #2632
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Queue/QueueService.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs index d4893ed53..6cacd3331 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs @@ -209,12 +209,10 @@ namespace HandBrakeWPF.Services.Queue if (result == MessageBoxResult.Yes) { + this.Stop(); + foreach (QueueTask task in duplicates) { - if (task.Status == QueueItemStatus.InProgress) - { - this.Stop(); - } this.queue.Remove(task); } @@ -224,11 +222,20 @@ namespace HandBrakeWPF.Services.Queue foreach (QueueTask task in reloadedQueue) { + // Reset the imported jobs that were running in a previous session. + if (task.Status == QueueItemStatus.InProgress) + { + task.Status = QueueItemStatus.Waiting; + task.Statistics.Reset(); + } + + // Ignore jobs if the user has chosen not to replace them. if (!replaceDuplicates && this.queue.Any(s => s.TaskId == task.TaskId)) { continue; - } - + } + + // If the above conditions are not met, add it back in. this.queue.Add(task); } |