DiffusionToolkit icon indicating copy to clipboard operation
DiffusionToolkit copied to clipboard

[BUG] Paths removed from the Excluded Folders list aren't removed

Open MisterSeajay opened this issue 9 months ago • 8 comments

Describe the bug Paths removed from the Excluded Folders list aren't removed after clicking Apply Changes.

Version: v1.9.0 (updated today)

Tool: N/A

To Reproduce

  1. Settings > Excluded Folders > Add Folder (in my case I added a sub-path of a folder already in the list while testing this feature).
  2. Click Apply Changes at the top.
  3. Switch to e.g. Search view.
  4. Check that this exclusion works, e.g. Tools > Folders > Remove excluded images.
  5. Settings > Excluded Folders > Remove Folder to remove the folder added in step 1
  6. Click Apply Changes at the top.
  7. Switch to e.g. Search view.
  8. Switch back to Settings; the removed folder is back in the Excluded Folders list.

Expected behavior Folders removed from the Excluded Folders list should stay removed!

Affected Image(s) N/A

Screenshots No sure this is needed; hopefully the steps listed above are sufficient.

Additional context I had been trying to work out whether the Excluded Folders would ignore/remove images from all sub-folders of each excluded path. Under my main images folder, I have a "temp" folder with lots of sub-folders and want to exclude ALL of these; this didn't work as I expected so I added one of these child folders explicitly and confirmed that I was able to exclude images from that folder.

MisterSeajay avatar Apr 22 '25 13:04 MisterSeajay

Hi, I've working on revamping the folder management.

Managing folders will be moved out of settings and into the Folder view

Image

Exclulded folders will be managed through the folder treeview

Image

I have a working build, if you need to fix your excluded folders. Would you like to try it?

RupertAvery avatar Apr 24 '25 16:04 RupertAvery

I don't need to fix it, but I don't mind testing if you'd like!

MisterSeajay avatar Apr 24 '25 21:04 MisterSeajay

I could even have a go at building from source. The README says to use dotNET 6.0 but the website says it is end-of-life. Is it worth trying dotNET 9.x?

MisterSeajay avatar Apr 24 '25 21:04 MisterSeajay

I'd like to update at some point, it shouldn't break anything either, so go ahead.

RupertAvery avatar Apr 25 '25 02:04 RupertAvery

Pushed my latest changes, feel free to try it out

RupertAvery avatar Apr 25 '25 04:04 RupertAvery

It built OK using dotNET 9.x (latest):

> dotnet publish Diffusion.Toolkit\Diffusion.Toolkit.csproj -c Release -r win-x64 -o .\build --no-self-contained /p:PublishSingleFile=true /p:PublishReadyToRun=false /p:DebugType=None /p:DebugSymbols=false

Restore succeeded with 1 warning(s) in 3.8s
... <lots of warnings> ...
Build succeeded with 2333 warning(s) in 13.7s

Quick feedback from 3 mins testing:

I like the Folder hierarchy view & it's easy to right-click a folder to exclude it. It would be good to have a show/hide excluded folders option in the View menu, rather than just highlighting them in red.

I have a number of folders showing in the Folders list which don't exist on disk. Perhaps these are caused by old entries in my database for images that have been moved and re-imported. I tried clicking "remove" on these folders, but nothing happened.

EDIT:

Just checked the database directly to look at one of these examples. I can see an entry in the Folder table for Folder Id 2:

Id  ParentId  Path
2   54        <my_image_root_path>\dreamshaper_7_saved
54  0         <my_image_root_path>

However, there aren't any enties in the Image table with a Folder Id of 2.

Deleting the entries directly from the SQLlite database cleaned up the Folder view.

MisterSeajay avatar Apr 25 '25 21:04 MisterSeajay

Thanks for testing! Having a second pair of eyes is a huge help! I guess I'll just have to take a look at that remove code again.

I'm thinking I can put a toggle in the folder treeview accordion header, next to refresh, that can toggle excluded folders. That will make it easier to use, but we can have it in the View menu in case it's not immediately obvious.

RupertAvery avatar Apr 26 '25 00:04 RupertAvery

Can you share your fix please?

ialhabbal avatar Sep 30 '25 10:09 ialhabbal