/// Function which generates the filename and path automatically based on \r
/// the Source Name, DVD title and DVD Chapters\r
/// </summary>\r
- public static string autoName(frmMain mainWindow ) //ComboBox drpDvdtitle, string chapter_start, string chatper_end, string source, string dest, int format, Boolean chapters)\r
+ public static string autoName(frmMain mainWindow) //ComboBox drpDvdtitle, string chapter_start, string chatper_end, string source, string dest, int format, Boolean chapters)\r
{\r
string AutoNamePath = string.Empty;\r
if (mainWindow.drp_dvdtitle.Text != "Automatic")\r
{\r
// Get the Source Name \r
- string sourceName = Path.GetFileNameWithoutExtension(mainWindow.sourcePath);\r
+ string sourceName = mainWindow.SourceName;\r
\r
// Get the Selected Title Number\r
string[] titlesplit = mainWindow.drp_dvdtitle.Text.Split(' ');\r
{\r
// Use the path and change the file extension to match the previous destination\r
AutoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.text_destination.Text), destinationFilename);\r
- AutoNamePath = Path.ChangeExtension(AutoNamePath, Path.GetExtension(mainWindow.text_destination.Text));\r
+\r
+ if (Path.HasExtension(mainWindow.text_destination.Text))\r
+ AutoNamePath = Path.ChangeExtension(AutoNamePath, Path.GetExtension(mainWindow.text_destination.Text));\r
}\r
}\r
\r
\r
// 0 = SVN Build / Version\r
// 1 = Build Date\r
+\r
+ DateTime lastModified = File.GetLastWriteTime("HandBrakeCLI.exe");\r
+\r
+\r
+ if (Properties.Settings.Default.cliLastModified == lastModified && Properties.Settings.Default.hb_build != 0)\r
+ return;\r
+\r
+ Properties.Settings.Default.cliLastModified = lastModified;\r
+ \r
Process cliProcess = new Process();\r
- ProcessStartInfo handBrakeCLI = new ProcessStartInfo("HandBrakeCLI.exe", " -u")\r
+ ProcessStartInfo handBrakeCLI = new ProcessStartInfo("HandBrakeCLI.exe", " -u -v0")\r
{\r
UseShellExecute = false,\r
RedirectStandardError = true,\r
while (!cliProcess.HasExited)\r
{\r
line = stdOutput.ReadLine() ?? "";\r
- Match m = Regex.Match(line, @"HandBrake ([0-9.]*)(svn[0-9M]*) \([0-9]*\)");\r
+ Match m = Regex.Match(line, @"HandBrake ([svnM0-9.]*) \([0-9]*\)");\r
Match platform = Regex.Match(line, @"- ([A-Za-z0-9\s ]*) -");\r
\r
if (m.Success)\r
cli.Kill();\r
}\r
}\r
+ Properties.Settings.Default.Save();\r
}\r
catch (Exception e)\r
{\r
{\r
try\r
{\r
- string tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.xml");\r
+ string tempPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\hb_queue_recovery.xml");\r
if (File.Exists(tempPath))\r
{\r
using (FileStream strm = new FileStream(tempPath, FileMode.Open, FileAccess.Read))\r