find-unlinked-files
find-unlinked-files copied to clipboard
Files used in canvas are detected as orphans
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.
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.
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.
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.
I would really appreciate having canvas links as part of the orphaned files search as well.
For those wondering, this is fixed in the PR linked above (https://github.com/Vinzent03/find-unlinked-files/pull/53). I just used this plugin to find and delete a bunch of orphaned images without any issue, and currently my sole use of Obsidian is for a single canvas page. So AFAIK this issue can be closed.
The plugin WILL still detect the canvas page itself as an orphaned file (assuming it's not linked to from elsewhere) unless you set your filetype filters in the plugins settings to avoid that.
E.g. The top 2 settings shown below will make sure the plugin only finds orphans that are png files (thus ignoring the canvas file itself), and the bottom setting will make sure that only png files listed in the output file are considered for deletion.
Also worth noting that the deletion command won't do anything at all unless you populate that last setting field.
Thanks, @mmseng. I'm closing this issue.