Vinzent03 / find-unlinked-files

Find files, which are nowhere linked, so they are maybe lost in your vault.
MIT License
293 stars 14 forks source link

Files used in canvas are detected as orphans #43

Open MrJGao opened 1 year ago

MrJGao commented 1 year ago

I found that when I insert an image, for example, into an obsidian canvas file, the image would be detected as an orphan when using the plugin. More importantly, I'd like to delete image files that are not used as attachments, but when I use the "delete certain orphan file types" command, the image I just inserted would be deleted.

Is there a way to exclude files used in canvas? Thanks.

Vinzent03 commented 1 year ago

I can reproduce, but I don't know how to fix that. Normally, Obsidian tracks the links and embeds per file in a cache, but it does not for canvas files.

MrJGao commented 1 year ago

I can reproduce, but I don't know how to fix that. Normally, Obsidian tracks the links and embeds per file in a cache, but it does not for canvas files.

Thanks for your response.

I have an idea but not sure if it's doable. I noticed that the .canvas files are in JSON format and they can be opened by any text editor. The .canvas files listed all the source materials they use. So, can we read the *.canvas files manually using this extension and then find the linked images/files? Thanks.

Vinzent03 commented 1 year ago

You are right, it's technical possible, but it's a bit tedious and more complicated to implement. Don't know when I get the time for this.

felipemeres commented 1 year ago

I would really appreciate having canvas links as part of the orphaned files search as well.