Use ToLowerInvariant

This commit is contained in:
Malte Rosenbjerg 2020-05-10 23:16:52 +02:00
parent af1bc4a80f
commit 188f37c9ee
7 changed files with 8 additions and 8 deletions

View file

@ -43,7 +43,7 @@ public static string OutputLocation(this FileInfo file, ImageType type)
public static string OutputLocation(this FileInfo file, Enum type, string keyword)
{
string originalLocation = file.Directory.FullName,
outputFile = file.Name.Replace(file.Extension, keyword + "." + type.ToString().ToLower());
outputFile = file.Name.Replace(file.Extension, keyword + "." + type.ToString().ToLowerInvariant());
return $"{originalLocation}{Path.DirectorySeparatorChar}{outputFile}";
}

View file

@ -13,6 +13,6 @@ public AudioCodecArgument(AudioCodec audioCodec)
AudioCodec = audioCodec;
}
public string Text => $"-c:a {AudioCodec.ToString().ToLower()}";
public string Text => $"-c:a {AudioCodec.ToString().ToLowerInvariant()}";
}
}

View file

@ -18,8 +18,8 @@ public BitStreamFilterArgument(Channel channel, Filter filter)
public string Text => Channel switch
{
Channel.Audio => $"-bsf:a {Filter.ToString().ToLower()}",
Channel.Video => $"-bsf:v {Filter.ToString().ToLower()}",
Channel.Audio => $"-bsf:a {Filter.ToString().ToLowerInvariant()}",
Channel.Video => $"-bsf:v {Filter.ToString().ToLowerInvariant()}",
_ => string.Empty
};
}

View file

@ -13,7 +13,7 @@ public ForceFormatArgument(string format)
_format = format;
}
public ForceFormatArgument(VideoCodec value) : this(value.ToString().ToLower()) { }
public ForceFormatArgument(VideoCodec value) : this(value.ToString().ToLowerInvariant()) { }
public string Text => $"-f {_format}";
}

View file

@ -14,6 +14,6 @@ public SpeedPresetArgument(Speed speed)
Speed = speed;
}
public string Text => $"-preset {Speed.ToString().ToLower()}";
public string Text => $"-preset {Speed.ToString().ToLowerInvariant()}";
}
}

View file

@ -14,7 +14,7 @@ public VideoCodecArgument(string codec)
Codec = codec;
}
public VideoCodecArgument(VideoCodec value) : this(value.ToString().ToLower()) { }
public VideoCodecArgument(VideoCodec value) : this(value.ToString().ToLowerInvariant()) { }
public string Text => $"-c:v {Codec} -pix_fmt yuv420p";
}

View file

@ -16,7 +16,7 @@ public class ImageInfo
/// <param name="fileInfo">Image file information.</param>
public ImageInfo(FileInfo fileInfo)
{
if (!fileInfo.Extension.ToLower().EndsWith(FileExtension.Png))
if (!fileInfo.Extension.ToLowerInvariant().EndsWith(FileExtension.Png))
{
throw new Exception("Image joining currently suppors only .png file types");
}