From 0ef15ccef9d0c44ab5102cf486bb420eda82a7f2 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 18 Apr 2015 15:43:57 +0000 Subject: WinGui: Small bug fix to handling of queue recovery when running mulitple instances. The GUI should not load the other app instances queue. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7098 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'win/CS/HandBrakeWPF') diff --git a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs index d2d9f1322..57033ae9d 100644 --- a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs @@ -126,7 +126,21 @@ namespace HandBrakeWPF.Helpers { foreach (string file in queueFiles) { - encodeQueue.RestoreQueue(appDataPath + file); // Start Recovery + // Skip over the file if it belongs to another HandBrake instance. + Match m = Regex.Match(file, @"([0-9]+).xml"); + if (m.Success) + { + int processId = int.Parse(m.Groups[1].ToString()); + if (processId != GeneralUtilities.ProcessId && GeneralUtilities.IsPidACurrentHandBrakeInstance(processId)) + { + continue; + } + } + + // Recover the Queue + encodeQueue.RestoreQueue(appDataPath + file); + + // Cleanup if (!file.Contains(GeneralUtilities.ProcessId.ToString(CultureInfo.InvariantCulture))) { try -- cgit v1.2.3