trganda / obsidian-attachment-management

Attachment Management of Obsidian
MIT License
142 stars 8 forks source link

Delete old/empty folders #99

Open nickchomey opened 5 months ago

nickchomey commented 5 months ago

When a note is moved, the attachments are automatically renamed/moved to the new file path. This leaves the folders of the old filepath empty - and continually growing.

Would it be possible to recursively check if the attachment's folder (and parent folders) are empty and, if so, delete them?

trganda commented 5 months ago

Try the latest version

sans-125 commented 5 months ago

If I set "Attachments" as the attachment folder and don't use the subfolders, when I rename/delete any file, it will delete all empty folders in the main folder. My plugin setting is as follows: image

And it's the problem: image

when I delete "test.md" file, it deletes all the empty folders and becomes like this: image

trganda commented 5 months ago

@sans-125 Tks for your report, it's fixed in latest version.