/// 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
// 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
if (ActivityWindow != null)\r
ActivityWindow.SetLogView(false);\r
- \r
+\r
}\r
this.Focus();\r
}\r
return;\r
}\r
\r
- switch (type) // Start the scan\r
- {\r
- case 1: // btn_dvd_source_Click()\r
- case 3: // mnu_dvd_drive_Click()\r
- sourcePath = Path.GetFullPath(file);\r
- startScan(file);\r
- break;\r
- case 2: // btn_file_source_Click()\r
- sourcePath = Path.GetFileName(file);\r
- startScan(file);\r
- break;\r
- }\r
+ sourcePath = Path.GetFileName(file);\r
+ startScan(file);\r
}\r
private void drp_dvdtitle_Click(object sender, EventArgs e)\r
{\r
else\r
newExtension = ".mp4";\r
\r
- text_destination.Text = text_destination.Text.Replace(".mp4", newExtension);\r
- text_destination.Text = text_destination.Text.Replace(".m4v", newExtension);\r
- text_destination.Text = text_destination.Text.Replace(".mkv", newExtension);\r
+ if (Path.HasExtension(newExtension))\r
+ text_destination.Text = Path.ChangeExtension(text_destination.Text, newExtension);\r
}\r
\r
//Video Tab\r