diff options
author | sr55 <[email protected]> | 2017-02-11 20:37:33 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2017-02-11 20:37:33 +0000 |
commit | 9ce3910fd193628e754abf4939c3758f1e57e100 (patch) | |
tree | bb7e367be99a36e85aa2c4beb1f45c243ae43c75 /win/CS/HandBrakeWPF/Helpers | |
parent | a1455ea947b0f85665228f23d2f94f66bdad2cdd (diff) |
WinGui: Fix a number of stylecop warnings.
Diffstat (limited to 'win/CS/HandBrakeWPF/Helpers')
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs | 20 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/PictureSize.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs | 2 |
3 files changed, 17 insertions, 7 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs index 47a852a0c..3465cfadf 100644 --- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs @@ -58,7 +58,7 @@ namespace HandBrakeWPF.Helpers {
// Get the Source Name and remove any invalid characters
string sourceName = Path.GetInvalidFileNameChars().Aggregate(sourceOrLabelName, (current, character) => current.Replace(character.ToString(), string.Empty));
- // string sanitisedPresetName = presetName != null ? Path.GetInvalidFileNameChars().Aggregate(presetName.Name, (current, character) => current.Replace(character.ToString(), string.Empty)) : string.Empty;
+ // string sanitisedPresetName = presetName != null ? Path.GetInvalidFileNameChars().Aggregate(presetName.Name, (current, character) => current.Replace(character.ToString(), string.Empty)) : string.Empty;
// Remove Underscores
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameRemoveUnderscore))
@@ -99,7 +99,7 @@ namespace HandBrakeWPF.Helpers .Replace(Constants.Chapters, combinedChapterTag)
.Replace(Constants.Date, DateTime.Now.Date.ToShortDateString().Replace('/', '-'))
.Replace(Constants.Time, DateTime.Now.ToString("HH:mm"));
- // .Replace(Constants.Preset, sanitisedPresetName);
+ // .Replace(Constants.Preset, sanitisedPresetName);
if (task.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality)
{
@@ -108,12 +108,16 @@ namespace HandBrakeWPF.Helpers }
else
{
- destinationFilename = destinationFilename.Replace(Constants.Bitrate, task.VideoBitrate.ToString());
+ destinationFilename = destinationFilename.Replace(
+ Constants.Bitrate,
+ task.VideoBitrate.ToString());
destinationFilename = destinationFilename.Replace(Constants.Quality, string.Empty);
}
}
else
+ {
destinationFilename = sourceName + "_T" + dvdTitle + "_C" + combinedChapterTag;
+ }
/*
* File Extension
@@ -134,7 +138,9 @@ namespace HandBrakeWPF.Helpers }
}
else if (task.OutputFormat == OutputFormat.Mkv)
+ {
destinationFilename += ".mkv";
+ }
/*
* File Destination Path
@@ -177,11 +183,15 @@ namespace HandBrakeWPF.Helpers {
autoNamePath = Path.Combine(userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath), destinationFilename);
}
- else // ...otherwise, output to the source directory
+ else
+ {
+ // ...otherwise, output to the source directory
autoNamePath = null;
+ }
}
- else // Otherwise, use the path that is already there.
+ else
{
+ // Otherwise, use the path that is already there.
// Use the path and change the file extension to match the previous destination
autoNamePath = Path.Combine(Path.GetDirectoryName(task.Destination), destinationFilename);
}
diff --git a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs index 40c73251a..93b85e6e4 100644 --- a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs +++ b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs @@ -186,7 +186,7 @@ namespace HandBrakeWPF.Helpers maxHeight = job.MaxHeight,
mode = (int)job.AnamorphicMode,
modulus = job.Modulus.HasValue ? job.Modulus.Value : 16,
- geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW }}
+ geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW } }
};
hb_geometry_s sourceGeometry = new hb_geometry_s
diff --git a/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs b/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs index 91a4ee1d8..e3f4dfb59 100644 --- a/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs @@ -9,8 +9,8 @@ namespace HandBrakeWPF.Helpers { - using System.Globalization; using System; + using System.Globalization; /// <summary> /// Helper functions for handling <see cref="TimeSpan"/> structures |