summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-12-03 17:56:04 +0000
committersr55 <[email protected]>2020-12-03 17:56:14 +0000
commit3b0bd7689579fb8012a3a6c00eae53243c61d8bd (patch)
treeb80554203b4981f41da76361443f62b692445ea3 /win/CS/HandBrakeWPF/Services
parent15601f1b4aa14126ccb06ccd8041bed41aa3a7bf (diff)
WinGui: Improvements to log handling for multi-instance
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs4
-rw-r--r--win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueService.cs6
-rw-r--r--win/CS/HandBrakeWPF/Services/Queue/QueueService.cs18
3 files changed, 26 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs b/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs
index 0cfd6e0f3..6754f534e 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs
@@ -249,8 +249,6 @@ namespace HandBrakeWPF.Services.Encode
this.ServiceLogMessage(completeMessage);
- this.logInstanceManager.Deregister(this.GetLogFilename());
-
// Handling Log Data
string hbLog = this.ProcessLogs(this.currentTask.Destination);
long filesize = this.GetFilesize(this.currentTask.Destination);
@@ -260,6 +258,8 @@ namespace HandBrakeWPF.Services.Encode
e.Error != 0
? new EventArgs.EncodeCompletedEventArgs(false, null, e.Error.ToString(), this.currentTask.Source, this.currentTask.Destination, hbLog, filesize)
: new EventArgs.EncodeCompletedEventArgs(true, null, string.Empty, this.currentTask.Source, this.currentTask.Destination, hbLog, filesize));
+
+ this.logInstanceManager.Deregister(this.GetLogFilename());
}
private long GetFilesize(string destination)
diff --git a/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueService.cs
index 2cbca0439..7e50ace75 100644
--- a/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueService.cs
+++ b/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueService.cs
@@ -153,6 +153,12 @@ namespace HandBrakeWPF.Services.Queue.Interfaces
void ClearCompleted();
/// <summary>
+ /// Get the log file paths for jobs still on the queue. (Including completed)
+ /// </summary>
+ /// <returns>List of filepaths</returns>
+ List<string> GetLogFilePaths();
+
+ /// <summary>
/// Get the first job on the queue for processing.
/// This also removes the job from the Queue and sets the LastProcessedJob
/// </summary>
diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
index c3c65f3c3..089072136 100644
--- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
+++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
@@ -349,6 +349,24 @@ namespace HandBrakeWPF.Services.Queue
});
}
+ public List<string> GetLogFilePaths()
+ {
+ List<string> logPaths = new List<string>();
+ lock (QueueLock)
+ {
+ foreach (QueueTask task in this.Queue)
+ {
+ if (!string.IsNullOrEmpty(task.Statistics.CompletedActivityLogPath))
+ {
+ logPaths.Add(task.Statistics.CompletedActivityLogPath);
+ }
+ }
+ }
+
+ return logPaths;
+ }
+
+
public QueueTask GetNextJobForProcessing()
{
if (this.queue.Count > 0)