From 9e3a75f85e327d9ed01543280c115d5853cd78e9 Mon Sep 17 00:00:00 2001 From: n00mkrad <61149547+n00mkrad@users.noreply.github.com> Date: Sun, 21 Dec 2025 15:20:24 +0100 Subject: [PATCH] Minor cleanup/refactor --- CodeLegacy/Main/InterpolateUtils.cs | 41 +++++++---------------------- CodeLegacy/Ui/UiUtils.cs | 1 - 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/CodeLegacy/Main/InterpolateUtils.cs b/CodeLegacy/Main/InterpolateUtils.cs index c07e3fc..13b34b6 100644 --- a/CodeLegacy/Main/InterpolateUtils.cs +++ b/CodeLegacy/Main/InterpolateUtils.cs @@ -141,7 +141,7 @@ namespace Flowframes.Main passes = false; } - if(passes && s.dedupe && I.currentMediaFile.IsVfr) + if (passes && s.dedupe && I.currentMediaFile.IsVfr) { UiUtils.ShowMessageBox($"Using de-duplication on VFR videos is currently not supported.\n\nGo to Quick Settings and either disable De-Duplication, or force VFR off."); passes = false; @@ -211,43 +211,22 @@ namespace Flowframes.Main return false; } - if (IoUtils.IsPathDirectory(path)) - { - if (!IoUtils.IsDirValid(path)) - { - UiUtils.ShowMessageBox("Input directory is not valid.\nMake sure it still exists and hasn't been renamed or moved!"); - I.Cancel(); - return false; - } - } - else - { - if (!IsVideoValid(path)) - { - UiUtils.ShowMessageBox("Input video file is not valid.\nMake sure it still exists and hasn't been renamed or moved!"); - return false; - } - } - return true; - } + bool isDir = IoUtils.IsPathDirectory(path); - public static async Task CheckEncoderValid() - { - string enc = I.currentSettings.outSettings.Encoder.GetInfo().Name; - - if (enc.Lower().Contains("nvenc") && !(await FfmpegCommands.IsEncoderCompatible(enc))) + if (isDir && !IoUtils.IsDirValid(path)) { - UiUtils.ShowMessageBox("NVENC encoding is not available on your hardware!\nPlease use a different encoder.", UiUtils.MessageType.Error); + UiUtils.ShowMessageBox("Input directory is not valid.\nMake sure it still exists and hasn't been renamed or moved!"); I.Cancel(); return false; } - return true; - } + if (!isDir && !IoUtils.IsFileValid(path)) + { + UiUtils.ShowMessageBox("Input video file is not valid.\nMake sure it still exists and hasn't been renamed or moved!"); + return false; + } - public static bool IsVideoValid(string videoPath) - { - return videoPath != null && IoUtils.IsFileValid(videoPath); + return true; } public static async Task GetOutputResolution(FfmpegCommands.ModuloMode moduloMode, string inputPath, bool print = false) diff --git a/CodeLegacy/Ui/UiUtils.cs b/CodeLegacy/Ui/UiUtils.cs index 65be816..669ce24 100644 --- a/CodeLegacy/Ui/UiUtils.cs +++ b/CodeLegacy/Ui/UiUtils.cs @@ -171,7 +171,6 @@ namespace Flowframes.Ui using (var testFont = new System.Drawing.Font(font, 8)) { bool isInstalled = string.Equals(font, testFont.Name, StringComparison.InvariantCultureIgnoreCase); - Logger.Log($"Font is {(isInstalled ? "" : "not ")}available: {font}", true); _fontAvailabilityCache[font] = isInstalled; return isInstalled; }