}\r
\r
string autoNamePath = string.Empty;\r
- if (task.Title != 0) // TODO check.\r
+ if (task.Title != 0)\r
{\r
// Get the Source Name and remove any invalid characters\r
string sourceName = Path.GetInvalidFileNameChars().Aggregate(sourceOrLabelName, (current, character) => current.Replace(character.ToString(), string.Empty));\r
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameRemoveUnderscore))\r
sourceName = sourceName.Replace("_", " ");\r
\r
+ if (userSettingService.GetUserSetting<bool>(UserSettingConstants.RemovePunctuation))\r
+ {\r
+ sourceName = sourceName.Replace("-", string.Empty);\r
+ sourceName = sourceName.Replace(",", string.Empty);\r
+ sourceName = sourceName.Replace(".", string.Empty); \r
+ }\r
+ \r
// Switch to "Title Case"\r
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameTitleCase))\r
sourceName = sourceName.ToTitleCase();\r
public static bool IsAutonamingEnabled()\r
{\r
IUserSettingService userSettingService = IoC.Get<IUserSettingService>();\r
- // If there is an auto name path, use it...\r
- if (userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim().StartsWith("{source_path}"))\r
- {\r
- return true;\r
- }\r
- else if (userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Contains("{source_folder_name}"))\r
- {\r
- return true;\r
- }\r
- else\r
+\r
+ if (!userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))\r
{\r
- return\r
- Directory.Exists(\r
- userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim());\r
+ return false;\r
}\r
+\r
+ // If there is an auto name path, use it...\r
+ return userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim().StartsWith("{source_path}") ||\r
+ (userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Contains("{source_folder_name}") ||\r
+ Directory.Exists(userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim()));\r
}\r
}\r
}\r
/// </summary>\r
public const string PreventSleep = "PreventSleep";\r
\r
+ /// <summary>\r
+ /// The remove punctuation.\r
+ /// </summary>\r
+ public const string RemovePunctuation = "RemovePunctuation";\r
+\r
#endregion\r
}\r
}
\ No newline at end of file
/// </summary>\r
private bool showAdvancedTab;\r
\r
+ /// <summary>\r
+ /// The remove punctuation.\r
+ /// </summary>\r
+ private bool removePunctuation;\r
+\r
#endregion\r
\r
#region Constructors and Destructors\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether remove punctuation.\r
+ /// </summary>\r
+ public bool RemovePunctuation\r
+ {\r
+ get\r
+ {\r
+ return this.removePunctuation;\r
+ }\r
+ set\r
+ {\r
+ this.removePunctuation = value;\r
+ this.NotifyOfPropertyChange(() => RemovePunctuation);\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#region Preview\r
\r
// Title case\r
this.ChangeToTitleCase = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameTitleCase);\r
+ this.RemovePunctuation = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.RemovePunctuation);\r
\r
// #############################\r
// Picture Tab\r
this.userSettingService.SetUserSetting(UserSettingConstants.UseM4v, this.SelectedMp4Extension);\r
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNameRemoveUnderscore, this.RemoveUnderscores);\r
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNameTitleCase, this.ChangeToTitleCase);\r
+ this.userSettingService.SetUserSetting(UserSettingConstants.RemovePunctuation, this.RemovePunctuation);\r
\r
/* Previews */\r
this.userSettingService.SetUserSetting(UserSettingConstants.VLC_Path, this.VLCPath);\r
<TextBlock Text="Available Options: {source} {title} {chapters} {date}" />\r
\r
<StackPanel Orientation="Horizontal" Margin="0,15,0,0">\r
- <CheckBox Content="Remove underscores from name" IsChecked="{Binding RemoveUnderscores}"/>\r
+ <CheckBox Content="Replace underscores with a space" IsChecked="{Binding RemoveUnderscores}"/>\r
+ <CheckBox Content="Remove common punctuation" ToolTip="Dash (-), Period (.) and Comma (,) " IsChecked="{Binding RemovePunctuation}" Margin="5,0,0,0"/>\r
<CheckBox Content="Change case to Title Case" IsChecked="{Binding ChangeToTitleCase}" Margin="5,0,0,0" />\r
</StackPanel>\r
\r
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
</value>\r
</item>\r
+ <item>\r
+ <key>\r
+ <string>RemovePunctuation</string>\r
+ </key>\r
+ <value>\r
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
+ </value>\r
+ </item>\r
</dictionary>
\ No newline at end of file