Skip to content

Commit bceaf8e

Browse files
author
David Khristepher Santos
committed
Allow Remove Root Folders from Fitlers panel
Add buttons to Filters Panel Add mp4, webm, mkv extensions on upgrade
1 parent d973a20 commit bceaf8e

9 files changed

Lines changed: 34 additions & 316 deletions

File tree

Diffusion.Toolkit/AlbumSortWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<RadioButton Grid.Column="1" VerticalAlignment="Center" IsChecked="{Binding SortAlbumsBy, Converter={StaticResource SortAlbumsByConverter}, ConverterParameter=Date}">Date Created</RadioButton>
4242
<RadioButton Grid.Column="2" VerticalAlignment="Center" IsChecked="{Binding SortAlbumsBy, Converter={StaticResource SortAlbumsByConverter}, ConverterParameter=Custom}">Custom</RadioButton>
4343
</Grid>
44-
<Grid Grid.Row="1" IsEnabled="{Binding SortAlbumsBy, Converter={StaticResource SortAlbumsByConverter}, ConverterParameter=Custom}">
44+
<Grid Grid.Row="1" >
4545
<Grid.ColumnDefinitions>
4646
<ColumnDefinition Width="380"/>
4747
<ColumnDefinition Width="3"></ColumnDefinition>
@@ -54,7 +54,7 @@
5454
</DataTemplate>
5555
</ListBox.ItemTemplate>
5656
</ListBox>
57-
<Grid Grid.Column="2" >
57+
<Grid Grid.Column="2" IsEnabled="{Binding SortAlbumsBy, Converter={StaticResource SortAlbumsByConverter}, ConverterParameter=Custom}">
5858
<StackPanel>
5959
<Button Height="25" Command="{Binding MoveUpCommand}" Margin="0,0,0,5">Up</Button>
6060
<Button Height="25" Command="{Binding MoveDownCommand}">Down</Button>

Diffusion.Toolkit/Localization/default.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@
147147
"Search.Folders": "Folders",
148148
"Search.Folders.AddRoot": "Add Root Folder",
149149
"Search.Folders.ManageExcluded": "To manage excluded folders, use the Folder TreeView (View > Folders) and right-click on a folder to exclude / unexclude it.",
150+
"Search.Folders.Buttons.Home.ToolTip": "Manage Root Folders",
151+
"Search.Folders.Buttons.CreateRootFolder.ToolTip": "New Root Folder",
152+
"Search.Folders.Buttons.Refresh.ToolTip": "Refresh",
150153
"Search.Models": "Models",
151154
"Search.Albums": "Albums",
152155
"Search.Favorites": "Favorites",
@@ -204,7 +207,6 @@
204207
"Search.Buttons.ShowFilter.ToolTip": "Filter",
205208
"Search.Buttons.Clear.ToolTip": "Clear",
206209
"Search.Buttons.Refresh.ToolTip": "Refresh",
207-
"Search.Folders.Buttons.Refresh.ToolTip": "Refresh",
208210
"Search.Albums.Buttons.ClearAlbums.ToolTip": "Clear",
209211
"Search.Albums.Buttons.SortAlbums.ToolTip": "Sort",
210212
"Search.Albums.Buttons.CreateAlbum.ToolTip": "New Album",

Diffusion.Toolkit/MainWindow.xaml.Folders.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ private async Task InitFolders()
4747

4848
_model.RemoveFolderCommand = new AsyncCommand<FolderViewModel>(async (o) =>
4949
{
50-
await ServiceLocator.FolderService.ShowRemoveFolderDialog(o);
50+
if (o.IsRoot)
51+
{
52+
await ServiceLocator.FolderService.ShowRemoveRootFolderDialog(o);
53+
}
54+
else
55+
{
56+
await ServiceLocator.FolderService.ShowRemoveFolderDialog(o);
57+
}
5158
});
5259

5360
_model.DeleteFolderCommand = new AsyncCommand<FolderViewModel>(async (o) =>

Diffusion.Toolkit/Models/FolderViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public ObservableCollection<FolderViewModel>? Children
5050
public int Depth { get; set; }
5151
public string Path { get; set; }
5252

53+
public bool IsRoot => Depth == 0;
54+
5355
public string Name
5456
{
5557
get;

Diffusion.Toolkit/Pages/Search.xaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,15 @@
290290
<ColumnDefinition/>
291291
<ColumnDefinition Width="26"/>
292292
<ColumnDefinition Width="26"/>
293+
<ColumnDefinition Width="26"/>
293294
</Grid.ColumnDefinitions>
294-
<Button Grid.Column="2" Style="{StaticResource BorderlessButton}"
295+
<Button Grid.Column="1" Style="{StaticResource BorderlessButton}" ToolTip="{lex:Loc Search.Folders.Buttons.Home.ToolTip}" Command="{Binding GoHome}">
296+
<fa:FontAwesome Icon="Home"></fa:FontAwesome>
297+
</Button>
298+
<Button Grid.Column="2" Style="{StaticResource BorderlessButton}" ToolTip="{lex:Loc Search.Folders.Buttons.CreateRootFolder.ToolTip}" Click="AddRootFolder_OnClick">
299+
<fa:FontAwesome Icon="Plus"></fa:FontAwesome>
300+
</Button>
301+
<Button Grid.Column="3" Style="{StaticResource BorderlessButton}"
295302
ToolTip="{lex:Loc Search.Folders.Buttons.Refresh.ToolTip}"
296303
Command="{Binding MainModel.ReloadFoldersCommand}"
297304
IsEnabled="{Binding MainModel.FoldersBusy, Converter={StaticResource InvertBoolConverter}}"

Diffusion.Toolkit/Pages/Search.xaml.Folders.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private void Folder_OnClick(object sender, MouseButtonEventArgs e)
166166
_model.NavigationSection.FoldersSection.CanCreateFolder = isSingleSelection && isAvailable;
167167
_model.NavigationSection.FoldersSection.CanDelete = !isRoot && isAvailable;
168168
_model.NavigationSection.FoldersSection.CanRename = !isRoot && isSingleSelection && isAvailable;
169-
_model.NavigationSection.FoldersSection.CanRemove = !isRoot && isSingleSelection;
169+
_model.NavigationSection.FoldersSection.CanRemove = isSingleSelection;
170170
_model.NavigationSection.FoldersSection.CanShowInExplorer = isSingleSelection && isAvailable;
171171
_model.NavigationSection.FoldersSection.CanArchive = isScanned && isAvailable && !isExcluded && !isArchived;
172172
_model.NavigationSection.FoldersSection.CanUnarchive =

Diffusion.Toolkit/Pages/Search.xaml.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,7 @@ public Search() : base("search")
346346

347347
_model.GoHome = new RelayCommand<object>((o) =>
348348
{
349-
if (_currentModeSettings.ViewMode == ViewMode.Folder)
350-
{
351-
OpenFolder(FolderViewModel.Home);
352-
}
349+
OpenFolder(FolderViewModel.Home);
353350
});
354351

355352
_model.GoUp = new RelayCommand<object>((o) =>

Diffusion.Toolkit/Release Notes/What's New v1.10.0.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ Download and install the [.NET Desktop Runtime](https://dotnet.microsoft.com/en-
1010

1111
This version adds support for indexing and previewing videos, and reading and indexing embedded ComfyUI workflows.
1212

13-
The ".mp4" extension will be added to **Settings > General > File Extensions**. You can Scan New on any folders containing videos. Any new scans should include MP4 files.
13+
The `.mp4`, `.webm` and `.mkv` extensions have been automatically added to **Settings > General > File Extensions**. You can Scan New on any folders containing videos. Any new scans should include video files.
1414

1515
A new setting has been added: **Settings > Video > Loop Video**. This controls whether the preview loops upon reaching the end of the video.
1616

17-
NOTE: Currently only ComfyUI workflows saved using the **VideoHelperSuite (VHS) - Video Combine** node are guaranteed to be read. If you have a ComfyUI video that has metadata that can't be read,
18-
please raise an issue and attach the sample file.
17+
**NOTE 1:** Currently only ComfyUI workflows saved using the **VideoHelperSuite (VHS) - Video Combine** node are guaranteed to be read.
18+
19+
**NOTE 2:** WebM and MKV are not supported for playback in the preview, and it will display as blank. This is because the .NET WPF MediaElement does not support these formats.
20+
21+
If you have a ComfyUI video that has metadata that can't be read, please raise an issue on Github and attach the sample file
1922

2023
## Tags
2124

@@ -35,7 +38,9 @@ The Tags filter should be visible. You can toggle it via **Menu > View > Tags**
3538
* Add support for ComfyUI workflows in JPEG files
3639
* Fixed errors reading Seed values larger than max INT
3740
* Fixed issues with Remove folders in Folder panel
38-
41+
* You can now remove root folders directly from the panel
42+
* You can remove unavailable root folders from the panel
43+
* Added some useful buttons to the Folders panel header
3944

4045

4146

0 commit comments

Comments
 (0)