From 6039bf88fe5e371af1fd45f898110265e3ce9624 Mon Sep 17 00:00:00 2001 From: JT Date: Mon, 30 Oct 2023 19:33:37 -0700 Subject: [PATCH] just ignore shared folders since its confusing --- .../ViewModels/OutputsPageViewModel.cs | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/StabilityMatrix.Avalonia/ViewModels/OutputsPageViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/OutputsPageViewModel.cs index 2817e11e..f43f6aa3 100644 --- a/StabilityMatrix.Avalonia/ViewModels/OutputsPageViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/OutputsPageViewModel.cs @@ -407,6 +407,11 @@ public partial class OutputsPageViewModel : PageViewModelBase ); foreach (var category in Categories) { + if (category.Name == "Shared Output Folder") + { + continue; + } + stackPanel.Children.Add( new CheckBox { @@ -490,7 +495,13 @@ public partial class OutputsPageViewModel : PageViewModelBase if (!settingsManager.IsLibraryDirSet) return; - if (!Directory.Exists(directory) && SelectedOutputType != SharedOutputType.All) + if ( + !Directory.Exists(directory) + && ( + SelectedCategory.Path != settingsManager.ImagesDirectory + || SelectedOutputType != SharedOutputType.All + ) + ) { Directory.CreateDirectory(directory); return; @@ -498,8 +509,16 @@ public partial class OutputsPageViewModel : PageViewModelBase var files = Directory .EnumerateFiles(directory, "*.png", SearchOption.AllDirectories) - .Select(file => LocalImageFile.FromPath(file)); + .Select(file => LocalImageFile.FromPath(file)) + .ToList(); - OutputsCache.EditDiff(files); + if (files.Count == 0) + { + OutputsCache.Clear(); + } + else + { + OutputsCache.EditDiff(files); + } } }