\r
if (logBuffer == null)\r
{\r
- ResetLogReader();\r
+ ResetLogReader(false);\r
ReadLastScanFile(); \r
}\r
\r
if (this.ScanStared != null)\r
this.ScanStared(this, new EventArgs());\r
\r
- ResetLogReader();\r
+ ResetLogReader(true);\r
\r
string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe");\r
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +\r
"\\HandBrake\\logs";\r
- string dvdInfoPath = Path.Combine(logDir, string.Format("last_scan_log{0}.txt", Init.InstanceId));\r
+ string dvdInfoPath = Path.Combine(logDir, string.Format("last_scan_log{0}.txt", Init.InstanceId == 0 ? string.Empty : Init.InstanceId.ToString()));\r
\r
// Make we don't pick up a stale last_encode_log.txt (and that we have rights to the file)\r
if (File.Exists(dvdInfoPath))\r
// we'll need to make a copy of it.\r
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +\r
"\\HandBrake\\logs";\r
- string logFile = Path.Combine(logDir, string.Format("last_scan_log{0}.txt", Init.InstanceId));\r
- string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", Init.InstanceId));\r
+ string logFile = Path.Combine(logDir, string.Format("last_scan_log{0}.txt", Init.InstanceId == 0 ? string.Empty : Init.InstanceId.ToString()));\r
+ string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", Init.InstanceId == 0 ? string.Empty : Init.InstanceId.ToString()));\r
\r
try\r
{\r
File.Copy(logFile, logFile2, true);\r
else\r
{\r
- ResetLogReader();\r
+ ResetLogReader(true);\r
return;\r
}\r
\r
catch (Exception exc)\r
{\r
Console.WriteLine(exc.ToString());\r
- ResetLogReader();\r
+ ResetLogReader(true);\r
}\r
}\r
}\r
/// <summary>\r
/// Reset the Log Reader\r
/// </summary>\r
- private void ResetLogReader()\r
+ /// <param name="addHeader">\r
+ /// The add Header.\r
+ /// </param>\r
+ private void ResetLogReader(bool addHeader)\r
{\r
logFilePosition = 0;\r
logBuffer = new StringBuilder();\r
- logBuffer.AppendLine(Logging.CreateCliLogHeader(null));\r
+ if (addHeader)\r
+ logBuffer.AppendLine(Logging.CreateCliLogHeader(null));\r
}\r
\r
/// <summary>\r