mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-24 20:29:26 +01:00
Fixed issues with custom output path and batch processing
This commit is contained in:
@@ -194,9 +194,8 @@ namespace Flowframes
|
||||
public void LoadBatchEntry(InterpSettings entry)
|
||||
{
|
||||
inputTbox.Text = entry.inPath;
|
||||
outputTbox.Text = entry.outPath;
|
||||
MainUiFunctions.SetOutPath(inputTbox, entry.outPath);
|
||||
interpFactorCombox.Text = entry.interpFactor.ToString();
|
||||
//aiCombox.SelectedIndex = Implementations.networks.IndexOf(entry.ai);
|
||||
aiCombox.SelectedIndex = Implementations.networks.IndexOf(Implementations.networks.Where(x => x.aiName == entry.ai.aiName).FirstOrDefault());
|
||||
SetOutMode(entry.outMode);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Flowframes.Main
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entry.outPath == null || !Directory.Exists(entry.outPath))
|
||||
if (entry.outPath == null || (!Directory.Exists(entry.outPath) && Config.GetInt("outFolderLoc") != 1))
|
||||
{
|
||||
Logger.Log("Queue: Can't process queue entry: Output path is invalid.");
|
||||
return false;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Flowframes.Ui
|
||||
if (Config.GetBool(Config.Key.clearLogOnInput))
|
||||
Logger.ClearLogBox();
|
||||
|
||||
outputTbox.Text = (Config.GetInt("outFolderLoc") == 0) ? inputTbox.Text.Trim().GetParentDir() : Config.Get("custOutDir").Trim();
|
||||
SetOutPath(inputTbox, inputTbox.Text.Trim().GetParentDir());
|
||||
|
||||
Program.lastInputPath = path;
|
||||
Program.lastInputPathIsSsd = OsUtils.DriveIsSSD(path);
|
||||
@@ -66,6 +66,28 @@ namespace Flowframes.Ui
|
||||
|
||||
}
|
||||
|
||||
public static bool SetOutPath (TextBox outputTbox, string outPath)
|
||||
{
|
||||
bool customOutDir = Config.GetInt("outFolderLoc") == 1;
|
||||
outputTbox.Text = customOutDir ? Config.Get("custOutDir").Trim() : outPath;
|
||||
|
||||
if (customOutDir)
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(outputTbox.Text);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Log($"Failed to create output folder: {e.Message}");
|
||||
outputTbox.Text = outPath;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void CheckExistingFolder (string inpath, string outpath)
|
||||
{
|
||||
if (Interpolate.current == null || !Interpolate.current.stepByStep) return;
|
||||
|
||||
Reference in New Issue
Block a user