From f6bb5723d1d4a23a3878628bb6fe146f536d1f8a Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 7 Sep 2020 22:44:30 +0100 Subject: WinGui: Performance Optimisation to the summary tab. Don't request previews when previews are turned off. Also thrown the delayed action processor on to avoid doing unnecessary work when bulk adding to the queue. #3117 Queue add should be near instant now. --- win/CS/HandBrakeWPF/Services/Queue/QueueService.cs | 2 +- win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'win/CS/HandBrakeWPF') diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs index 44e2eb31a..7789a14fd 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs @@ -575,7 +575,7 @@ namespace HandBrakeWPF.Services.Queue { try { - delayedQueueBackupProcessor.PerformTask(() => this.BackupQueue(string.Empty), 1000); + delayedQueueBackupProcessor.PerformTask(() => this.BackupQueue(string.Empty), 200); } catch (Exception) { diff --git a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs index 544956916..d07d4187d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs @@ -52,6 +52,8 @@ namespace HandBrakeWPF.ViewModels private bool showPreview; + private DelayedActionProcessor previewDelayProcessor = new DelayedActionProcessor(); + public SummaryViewModel(IScan scanService, IUserSettingService userSettingService) { this.scanService = scanService; @@ -390,7 +392,10 @@ namespace HandBrakeWPF.ViewModels } this.PopulateSummaryTab(); - this.UpdatePreviewFrame(); + if (this.ShowPreview) + { + this.previewDelayProcessor.PerformTask(this.UpdatePreviewFrame, 250); + } } public void SetContainer(OutputFormat container) -- cgit v1.2.3