mirror of
https://github.com/n00mkrad/flowframes.git
synced 2026-09-01 19:51:28 +02:00
Improved path char check, fixed SBS GUI
This commit is contained in:
@@ -108,7 +108,7 @@ namespace Flowframes
|
||||
public static string StripBadChars(this string str)
|
||||
{
|
||||
string outStr = Regex.Replace(str, @"[^\u0020-\u007E]", string.Empty);
|
||||
outStr = outStr.Remove("(").Remove(")").Remove("[").Remove("]").Remove("{").Remove("}").Remove("%").Remove("'");
|
||||
outStr = outStr.Remove("(").Remove(")").Remove("[").Remove("]").Remove("{").Remove("}").Remove("%").Remove("'").Remove("~");
|
||||
return outStr;
|
||||
}
|
||||
|
||||
|
||||
@@ -432,7 +432,8 @@ namespace Flowframes
|
||||
stepSelector.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
runBtn.Visible = Config.GetInt("processingMode") == 1 || Program.busy;
|
||||
bool stepByStep = Config.GetInt("processingMode") == 1;
|
||||
runBtn.Visible = !stepByStep && !Program.busy;
|
||||
}
|
||||
|
||||
private async void runStepBtn_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -749,5 +749,10 @@ namespace Flowframes.IO
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public static bool HasBadChars(string str)
|
||||
{
|
||||
return str != str.StripBadChars();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Flowframes
|
||||
if (!Utils.CheckAiAvailable(current.ai)) return; // Check if selected AI pkg is installed
|
||||
if (!Utils.CheckDeleteOldTempFolder()) return; // Try to delete temp folder if an old one exists
|
||||
if (!Utils.CheckPathValid(current.inPath)) return; // Check if input path/file is valid
|
||||
Utils.PathAsciiCheck(current.inPath, current.outPath);
|
||||
Utils.PathAsciiCheck(current.outPath, "output path");
|
||||
currentInputFrameCount = await Utils.GetInputFrameCountAsync(current.inPath);
|
||||
current.stepByStep = false;
|
||||
Program.mainForm.SetStatus("Starting...");
|
||||
|
||||
@@ -253,18 +253,10 @@ namespace Flowframes.Main
|
||||
return passes;
|
||||
}
|
||||
|
||||
public static void PathAsciiCheck (string inpath, string outpath)
|
||||
{
|
||||
bool shownMsg = false;
|
||||
|
||||
if (OSUtils.HasNonAsciiChars(inpath))
|
||||
{
|
||||
ShowMessage("Warning: Input path includes non-ASCII characters. This might cause problems.");
|
||||
shownMsg = true;
|
||||
}
|
||||
|
||||
if (!shownMsg && OSUtils.HasNonAsciiChars(outpath))
|
||||
ShowMessage("Warning: Output path includes non-ASCII characters. This might cause problems.");
|
||||
public static void PathAsciiCheck (string path, string pathTitle)
|
||||
{
|
||||
if (IOUtils.HasBadChars(path) || OSUtils.HasNonAsciiChars(path))
|
||||
ShowMessage($"Warning: Your {pathTitle} includes special characters. This might cause problems.");
|
||||
}
|
||||
|
||||
public static void GifCompatCheck (Interpolate.OutMode outMode, float fpsOut, int targetFrameCount)
|
||||
|
||||
@@ -20,12 +20,13 @@ namespace Flowframes.UI
|
||||
{
|
||||
Program.mainForm.SetTab("interpolate");
|
||||
Program.mainForm.ResetInputInfo();
|
||||
string path = inputTbox.Text.Trim();
|
||||
InterpolateUtils.PathAsciiCheck(path, "input path");
|
||||
|
||||
if (Config.GetBool("clearLogOnInput"))
|
||||
Logger.ClearLogBox();
|
||||
|
||||
outputTbox.Text = inputTbox.Text.Trim().GetParentDir();
|
||||
string path = inputTbox.Text.Trim();
|
||||
Program.lastInputPath = path;
|
||||
Program.lastInputPathIsSsd = OSUtils.DriveIsSSD(path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user