husjon / obsidian-file-cleaner-redux

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

Images in the Canvas (Core Plugin) are also being deleted #31

Closed premgowda98 closed 7 months ago

premgowda98 commented 7 months ago

Images which are directly added in the canvas are considered to be not in use and are getting deleted.

husjon commented 7 months ago

Hi, thanks for raising the issue. I'll take a look at it over the weekend.

Just to make sure, you are on the latest version v0.8.1?

husjon commented 7 months ago

There seem to be a delay from when adding an image to the canvas until it is actually registered as having a parent (aka not unused / orphaned), this seem to be a couple of seconds. This can be forced by saving the canvas manually.

Other than that I've not been able to entirely replicate it.

premgowda98 commented 7 months ago

Thanks, will try to replicate it and check once more.

00xBAD commented 7 months ago

I can confirm this issue. In my extensions settings i have the wildcard .* filter

If i create a canvas, and add media to it, without have that media referenced elsewhere, it clean up that media's..

P.S. .canvas files if not referenced/backlinked are added to cleanup. (maybe add a setting to cleanup only 0 kb files?)

EDIT: The issue is only related to images that are embedded into cards, if you drag-n-drop an image on canvas it's working fine the plugin.

image

husjon commented 7 months ago

Hi @00xBAD thanks for the added information about images being embedded into cards, this should allow me to replicate it and get a fix out.

As for

P.S. .canvas files if not referenced/backlinked are added to cleanup. (maybe add a setting to cleanup only 0 kb files?)

This should not be the case, but if you still see it, please create a separate issue for it and we'll take a look.

husjon commented 7 months ago

@premgowda98 I suspect the above mentioned issue is what you also saw?

husjon commented 7 months ago

I've prepared a fix for this and it will be part of v0.8.2 and should be available soon. For now the issue will be closed but please feel free to re-open if needed.