diff options
author | sr55 <[email protected]> | 2016-03-26 19:13:22 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2016-03-26 19:13:22 +0000 |
commit | 1c64294301cb511a1e088750f810121c4661aabc (patch) | |
tree | 37e3e8c1632ce69f9cc01654960efa1210b6bde5 /win/CS/HandBrakeWPF | |
parent | ce9543f4b6ac63f413287081d5ee4bd1ab14f56b (diff) |
WinGui: If there are multiple queue recovery files, don't fail the set if one is bad. Let the rest load normally.
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs index 143288403..04274e791 100644 --- a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs @@ -11,6 +11,7 @@ namespace HandBrakeWPF.Helpers {
using System;
using System.Collections.Generic;
+ using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
@@ -53,23 +54,30 @@ namespace HandBrakeWPF.Helpers IEnumerable<FileInfo> logFiles = info.GetFiles("*.xml").Where(f => f.Name.StartsWith("hb_queue_recovery"));
foreach (FileInfo file in logFiles)
{
- using (FileStream strm = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
+ try
{
- List<QueueTask> list = Ser.Deserialize(strm) as List<QueueTask>;
- if (list != null && list.Count == 0)
+ using (FileStream strm = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
{
- removeFiles.Add(file.FullName);
- }
+ List<QueueTask> list = Ser.Deserialize(strm) as List<QueueTask>;
+ if (list != null && list.Count == 0)
+ {
+ removeFiles.Add(file.FullName);
+ }
- if (list != null && list.Count != 0)
- {
- List<QueueTask> tasks = list.Where(l => l.Status != QueueItemStatus.Completed).ToList();
- if (tasks.Count != 0)
+ if (list != null && list.Count != 0)
{
- queueFiles.Add(file.Name);
+ List<QueueTask> tasks = list.Where(l => l.Status != QueueItemStatus.Completed).ToList();
+ if (tasks.Count != 0)
+ {
+ queueFiles.Add(file.Name);
+ }
}
}
}
+ catch (Exception exc)
+ {
+ Debug.WriteLine(exc);
+ }
}
// Cleanup old/unused queue files for now.
@@ -90,8 +98,9 @@ namespace HandBrakeWPF.Helpers return queueFiles;
}
- catch (Exception)
+ catch (Exception exc)
{
+ Debug.WriteLine(exc);
return new List<string>(); // Keep quiet about the error.
}
}
|