Make export file separator ('-' by default) customizable in config

This commit is contained in:
N00MKRAD
2021-03-03 18:40:08 +01:00
parent b630a2ae68
commit a6dca1906e
3 changed files with 6 additions and 3 deletions

View File

@@ -165,6 +165,8 @@ namespace Flowframes.IO
if (key == "modelsBaseUrl") return WriteDefault(key, "https://raw.githubusercontent.com/n00mkrad/flowframes/main/Models/");
if (key == "ffEncPreset") return WriteDefault(key, "medium");
if (key == "ffEncArgs") return WriteDefault(key, "");
// Misc, not exposed in UI
if (key == "exportFilenameSeparator") return WriteDefault(key, "-");
if (type == Type.Int || type == Type.Float) return WriteDefault(key, "0"); // Write default int/float (0)
if (type == Type.Bool) return WriteDefault(key, "False"); // Write default bool (False)

View File

@@ -413,9 +413,10 @@ namespace Flowframes.IO
public static string GetExportSuffix(float factor, AI ai, string mdl)
{
string suffix = $"-{factor.ToStringDot()}x-{ai.aiNameShort.ToUpper()}";
string sep = Config.Get("exportFilenameSeparator");
string suffix = $"{sep}{factor.ToStringDot()}x{sep}{ai.aiNameShort.ToUpper()}";
if (Config.GetBool("modelSuffix"))
suffix += $"-{mdl}";
suffix += $"{sep}{mdl}";
return suffix;
}

View File

@@ -57,7 +57,7 @@ namespace Flowframes.Main
await Encode(mode, path, outPath, I.current.outFps);
if (fpsLimit)
await Encode(mode, path, outPath.FilenameSuffix($"-{maxFps.ToStringDot("0.00")}fps"), I.current.outFps, maxFps);
await Encode(mode, path, outPath.FilenameSuffix($"{Config.Get("exportFilenameSeparator")}{maxFps.ToStringDot("0.00")}fps"), I.current.outFps, maxFps);
}
catch (Exception e)
{