summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs31
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.
}
}