husjon / obsidian-file-cleaner-redux

A plugin for Obsidian to help clean up files in your vault
MIT License
29 stars 2 forks source link

Add support for EXCLUDING attachment extensions #36

Closed situfang closed 6 months ago

situfang commented 8 months ago

Great plugin. Being able to configure attachment extensions that need to be cleaned is a nice feature. From the perspective of my usage, I would like to clean up all useless extensions (configure ".*" directly), but exclude specified suffix names, such as .mdenc (which is used by another encryption plug-in and should not be cleaned up). Thank you!

husjon commented 8 months ago

Hm, so if I understand you correctly, you'd like inverse matching.

F.ex if you have the following files:

file.md
file.jpg
file.png
file.pdf
file.mdenc

And you set your filter to be:

.md
.mdenc

You want it to all files except .mdand .mdenc to removed?

So that the remaining files should be:

file.md
file.mdenc
situfang commented 8 months ago

Yes, that's basically what I expected. But it would be more reasonable not to clean up the .md file for the plugin. I think .md does not need to be configured here, otherwise the user may delete them by mistake.

husjon commented 8 months ago

Thanks for the feedback. The only reason why the markdown files would be cleaned up is if they are empty so they wouldn't be removed by mistake :)

I'll have a look at how to implement it and get back to you when it's ready.

husjon commented 6 months ago

Hey @situfang, just a heads up that I've implemented this and it will be part of v0.9.0 releasing soon. This issue will be closed automatically when the PR has been merged.