summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/CS/HandBrakeWPF/Constants.cs10
-rw-r--r--win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs4
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs15
3 files changed, 24 insertions, 5 deletions
diff --git a/win/CS/HandBrakeWPF/Constants.cs b/win/CS/HandBrakeWPF/Constants.cs
index 7295c9339..1d279427a 100644
--- a/win/CS/HandBrakeWPF/Constants.cs
+++ b/win/CS/HandBrakeWPF/Constants.cs
@@ -28,5 +28,15 @@ namespace HandBrakeWPF
/// The any.
/// </summary>
public const string Any = "(Any)";
+
+ /// <summary>
+ /// The chapters.
+ /// </summary>
+ public const string Chapters = "{chapters}";
+
+ /// <summary>
+ /// The title.
+ /// </summary>
+ public const string Title = "{title}";
}
}
diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
index 5c4e83cb1..2298eb4ab 100644
--- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
@@ -79,8 +79,8 @@ namespace HandBrakeWPF.Helpers
{
destinationFilename = userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat);
destinationFilename = destinationFilename.Replace("{source}", sourceName)
- .Replace("{title}", dvdTitle)
- .Replace("{chapters}", combinedChapterTag)
+ .Replace(Constants.Title, dvdTitle)
+ .Replace(Constants.Chapters, combinedChapterTag)
.Replace("{date}", DateTime.Now.Date.ToShortDateString().Replace('/', '-'));
}
else
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index fb14cd9a1..e3fd2dfc1 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -700,7 +700,11 @@ namespace HandBrakeWPF.ViewModels
if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))
{
- this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ if (this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat) != null &&
+ this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat).Contains(Constants.Title))
+ {
+ this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ }
}
this.NotifyOfPropertyChange(() => this.CurrentTask);
@@ -751,7 +755,11 @@ namespace HandBrakeWPF.ViewModels
if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming) && this.ScannedSource.ScanPath != null)
{
- this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ if (this.SelectedPointToPoint == PointToPointMode.Chapters && this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat) != null &&
+ this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat).Contains(Constants.Chapters))
+ {
+ this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ }
}
}
}
@@ -771,7 +779,8 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedEndPoint);
this.Duration = this.DurationCalculation();
- if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming) && this.ScannedSource.ScanPath != null)
+ if (this.SelectedPointToPoint == PointToPointMode.Chapters && this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat) != null &&
+ this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat).Contains(Constants.Chapters))
{
this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
}