Fixed temp folder not deleting, attempt at fixing pkg download

This commit is contained in:
N00MKRAD
2020-12-03 21:02:50 +01:00
parent 0fb7b2cca3
commit 896e656e03
3 changed files with 14 additions and 6 deletions

View File

@@ -36,15 +36,16 @@ namespace Flowframes.IO
public static async Task DownloadAndInstall(string filename, bool showDialog = true)
{
string savePath = Path.Combine(Paths.GetPkgPath(), filename);
string url = $"https://dl.nmkd.de/flowframes/pkgs/{filename}";
string url = $"http://dl.nmkd.de/flowframes/pkgs/{filename}";
Logger.Log($"[PkgInstaller] Downloading {url}", true);
var client = new WebClient();
//client.Proxy = WebRequest.DefaultWebProxy;
client.Proxy = WebRequest.DefaultWebProxy;
Print($"Downloading {filename}...");
sw.Restart();
client.DownloadProgressChanged += (sender, args) =>
{
if (sw.ElapsedMilliseconds > 200)
if (sw.ElapsedMilliseconds > 250)
{
sw.Restart();
Print($"Downloading {filename}... {args.ProgressPercentage}%", true);
@@ -52,9 +53,13 @@ namespace Flowframes.IO
};
client.DownloadFileCompleted += (sender, args) =>
{
if (args.Error != null)
Print("Download failed: " + args.Error.Message);
Print($"Downloading {filename}... 100%", true);
};
await client.DownloadFileTaskAsync(new Uri(url), savePath);
try
{
if (Path.GetExtension(filename).ToLower() == ".7z") // Only run extractor if it's a 7z archive

View File

@@ -144,7 +144,7 @@ namespace Flowframes
public static async Task PostProcessFrames (bool sbsMode = false)
{
bool firstFrameFix = (!sbsMode && lastAi.aiName == Networks.rifeCuda.aiName) || (sbsMode && InterpolateSteps.currentAi.aiName == Networks.rifeCuda.aiName);
//firstFrameFix = false; // TODO: Remove firstframefix if new rife code works
firstFrameFix = false; // TODO: Remove firstframefix if new rife code works
if (!Directory.Exists(currentFramesPath) || IOUtils.GetAmountOfFiles(currentFramesPath, false, "*.png") <= 0)
{
@@ -185,7 +185,7 @@ namespace Flowframes
{
currentlyUsingAutoEnc = IOUtils.GetAmountOfFiles(currentFramesPath, false) * lastInterpFactor >= (AutoEncode.chunkSize + AutoEncode.safetyBufferFrames) * 1.2f;
//Logger.Log("Using autoenc if there's more than " + (AutoEncode.chunkSize + AutoEncode.safetyBufferFrames) * 1.2f + " input frames, got " + IOUtils.GetAmountOfFiles(currentFramesPath, false) * lastInterpFactor);
currentlyUsingAutoEnc = false;
//currentlyUsingAutoEnc = false;
Directory.CreateDirectory(outpath);
@@ -241,7 +241,7 @@ namespace Flowframes
canceled = true;
Program.mainForm.SetStatus("Canceled.");
Program.mainForm.SetProgress(0);
if (Config.GetInt("processingMode") == 1 && !Config.GetBool("keepTempFolder"))
if (Config.GetInt("processingMode") == 0 && !Config.GetBool("keepTempFolder"))
IOUtils.TryDeleteIfExists(currentTempDir);
Program.mainForm.SetWorking(false);
Program.mainForm.SetTab("interpolation");

View File

@@ -76,7 +76,10 @@ namespace Flowframes.OS
string sysPyVer = GetSysPyVersion();
if (!string.IsNullOrWhiteSpace(sysPyVer) && !sysPyVer.ToLower().Contains("not found") && sysPyVer.Length <= 35)
{
isInstalled = true;
Logger.Log("Using Python installation: " + sysPyVer, false, true);
}
hasCheckedSysPy = true;
sysPyInstalled = isInstalled;