From 9f298c544fdbf31400456116a61785003048a770 Mon Sep 17 00:00:00 2001 From: Krowe Moh <27891447+Krowe-moh@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:18:00 +1100 Subject: [PATCH] Prevent Export logs on Search menu extracts reduces logs flood causing slowdown on export --- .../Commands/RightClickMenuCommand.cs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/FModel/ViewModels/Commands/RightClickMenuCommand.cs b/FModel/ViewModels/Commands/RightClickMenuCommand.cs index b490957c..e82b4905 100644 --- a/FModel/ViewModels/Commands/RightClickMenuCommand.cs +++ b/FModel/ViewModels/Commands/RightClickMenuCommand.cs @@ -43,6 +43,7 @@ public class RightClickMenuCommand : ViewModelCommand if (param.Length == 0) return; var folders = param.OfType().ToArray(); + var searchMenu = param[0] is GameFile; var assets = param .Select(static item => item switch { @@ -138,6 +139,20 @@ public class RightClickMenuCommand : ViewModelCommand _ => (entry, bulk, update) => contextViewModel.CUE4Parse.Extract(cancellationToken, entry, false, bulk), }; + if (searchMenu) + { + var update = assets.Length > 1; + foreach (var entry in assets) + { + Thread.Yield(); + cancellationToken.ThrowIfCancellationRequested(); + fileAction(entry, bulktype | EBulkType.Auto, update); + } + + LogExport(contextViewModel, filetype); + return; + } + foreach (var group in assetsGroups) { var directory = group.Key; @@ -190,4 +205,26 @@ public class RightClickMenuCommand : ViewModelCommand Interlocked.Exchange(ref contextViewModel.CUE4Parse.ExportedCount, 0); Interlocked.Exchange(ref contextViewModel.CUE4Parse.FailedExportCount, 0); } + + private void LogExport(ApplicationViewModel contextViewModel, string fileType) + { + if (contextViewModel.CUE4Parse.ExportedCount > 0) + { + FLogger.Append(ELog.Information, () => + { + FLogger.Text($"Successfully exported {contextViewModel.CUE4Parse.ExportedCount} {fileType}", Constants.WHITE, true); + }); + } + + if (contextViewModel.CUE4Parse.FailedExportCount > 0) + { + FLogger.Append(ELog.Error, () => + { + FLogger.Text($"Failed to export {contextViewModel.CUE4Parse.FailedExportCount} {fileType}", Constants.WHITE, true); + }); + } + + Interlocked.Exchange(ref contextViewModel.CUE4Parse.ExportedCount, 0); + Interlocked.Exchange(ref contextViewModel.CUE4Parse.FailedExportCount, 0); + } }