Skip to content

Commit

Permalink
Remove ToStringDot, no longer needed with forced CultureInfo
Browse files Browse the repository at this point in the history
n00mkrad committed Nov 26, 2024
1 parent 67cbff5 commit b9029cb
Showing 6 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CodeLegacy/Data/Paths.cs
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ public static void Init()

public static string GetFrameOrderFilename(float factor)
{
return $"{frameOrderPrefix}-{factor.ToStringDot()}x.ini";
return $"{frameOrderPrefix}-{factor.ToString()}x.ini";
}

public static string GetFrameOrderFilenameChunk (int from, int to)
8 changes: 0 additions & 8 deletions CodeLegacy/Extensions/ExtensionMethods.cs
Original file line number Diff line number Diff line change
@@ -239,14 +239,6 @@ public static string FilenameSuffix(this string path, string suffix)
return filename + suffix + ext;
}

public static string ToStringDot(this float f, string format = "")
{
if (string.IsNullOrWhiteSpace(format))
return f.ToString().Replace(",", ".");
else
return f.ToString(format).Replace(",", ".");
}

public static string[] Split(this string str, string trimStr)
{
return str?.Split(new string[] { trimStr }, StringSplitOptions.None);
4 changes: 2 additions & 2 deletions CodeLegacy/IO/Config.cs
Original file line number Diff line number Diff line change
@@ -210,7 +210,7 @@ public static float GetFloat(Key key)

public static float GetFloat(Key key, float defaultVal)
{
WriteIfDoesntExist(key.ToString(), defaultVal.ToStringDot());
WriteIfDoesntExist(key.ToString(), defaultVal.ToString());
return Get(key, Type.Float).GetFloat();
}

@@ -221,7 +221,7 @@ public static float GetFloat(string key)

public static float GetFloat(string key, float defaultVal)
{
WriteIfDoesntExist(key, defaultVal.ToStringDot());
WriteIfDoesntExist(key, defaultVal.ToString());
return Get(key, Type.Float).GetFloat();
}

4 changes: 2 additions & 2 deletions CodeLegacy/IO/IoUtils.cs
Original file line number Diff line number Diff line change
@@ -610,10 +610,10 @@ public static async Task<string> GetCurrentExportFilename(bool fpsLimit, bool is

filename = filename.Replace("[NAME]", inName);
filename = filename.Replace("[FULLNAME]", Path.GetFileName(curr.inPath));
filename = filename.Replace("[FACTOR]", curr.interpFactor.ToStringDot());
filename = filename.Replace("[FACTOR]", curr.interpFactor.ToString());
filename = filename.Replace("[AI]", curr.ai.NameShort.Upper());
filename = filename.Replace("[MODEL]", curr.model.Name.Remove(" "));
filename = filename.Replace("[FPS]", fps.ToStringDot("0.###"));
filename = filename.Replace("[FPS]", fps.ToString("0.###"));
filename = filename.Replace("[ROUNDFPS]", fps.RoundToInt().ToString());
filename = filename.Replace("[RES]", $"{outRes.Width}x{outRes.Height}");
filename = filename.Replace("[H]", $"{outRes.Height}p");
6 changes: 3 additions & 3 deletions CodeLegacy/Media/FfmpegUtils.cs
Original file line number Diff line number Diff line change
@@ -526,11 +526,11 @@ private static string GetAudioFilters(float itsScale)
return "";

if (itsScale > 4)
return $"-af atempo=0.5,atempo=0.5,atempo={((1f / itsScale) * 4).ToStringDot()}";
return $"-af atempo=0.5,atempo=0.5,atempo={((1f / itsScale) * 4).ToString()}";
else if (itsScale > 2)
return $"-af atempo=0.5,atempo={((1f / itsScale) * 2).ToStringDot()}";
return $"-af atempo=0.5,atempo={((1f / itsScale) * 2).ToString()}";
else
return $"-af atempo={(1f / itsScale).ToStringDot()}";
return $"-af atempo={(1f / itsScale).ToString()}";
}

public static string GetSubCodecForContainer(string containerExt)
2 changes: 1 addition & 1 deletion CodeLegacy/Os/AiProcess.cs
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@ public static async Task RunRifeCudaProcess(string inPath, string outDir, string
string uhdStr = InterpolateUtils.UseUhd() ? "--UHD" : "";
string wthreads = $"--wthreads {2 * (int)interpFactor}";
string rbuffer = $"--rbuffer {Config.GetInt(Config.Key.rifeCudaBufferSize, 200)}";
//string scale = $"--scale {Config.GetFloat("rifeCudaScale", 1.0f).ToStringDot()}";
//string scale = $"--scale {Config.GetFloat("rifeCudaScale", 1.0f).ToString()}";
string prec = Config.GetBool(Config.Key.rifeCudaFp16) ? "--fp16" : "";
string args = $" --input {inPath.Wrap()} --output {outDir} --model {mdl} --multi {interpFactor} {uhdStr} {wthreads} {rbuffer} {prec}";

0 comments on commit b9029cb

Please sign in to comment.