From f4fb4e511d4f8d47d615e33536c4c7093e2eefb7 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 15 Jun 2018 20:00:31 +0100 Subject: [PATCH] WinGui: Fix a bug in queue recovery where old files were not deleted. --- win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs index 4b9aa4f81..bf62d5a69 100644 --- a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs @@ -36,6 +36,9 @@ namespace HandBrakeWPF.Helpers /// If it does, it means the last queue did not complete before HandBrake closed. /// So, return a boolean if true. /// + /// + /// The filter Queue Files. + /// /// /// True if there is a queue to recover. /// @@ -156,7 +159,7 @@ namespace HandBrakeWPF.Helpers isRecovered = true; // Cleanup - CleanupFiles(new List { Path.Combine(appDataPath, file) }); + CleanupFiles(new List { file }); } return isRecovered; @@ -189,6 +192,8 @@ namespace HandBrakeWPF.Helpers private static void CleanupFiles(List removeFiles) { + string appDataPath = DirectoryUtilities.GetUserStoragePath(VersionHelper.IsNightly()); + // Cleanup old/unused queue files for now. foreach (string file in removeFiles) { @@ -202,7 +207,8 @@ namespace HandBrakeWPF.Helpers } } - File.Delete(file); + string fullPath = Path.Combine(appDataPath, file); + File.Delete(fullPath); } } } -- 2.40.0