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

feat: Include canvas files when determining orphans #53

Closed MostlyArmless closed 6 months ago

MostlyArmless commented 11 months ago

Main change

Mainly, this change is to close issue #43:

  1. We've already loaded a list of all vault files, so filter out just the .canvas files
  2. loop over the canvas files, load their contents, parse the JSON and find any links to other files. That set of links is the same one that we're already populating when iterating all the markdown files.
  3. Now, when we check if a file is orphaned, this plugin will no longer consider a file to be orphaned if it exists in or is linked to from exclusively .canvas files.

I smoke tested this briefly on my vault and didn't see any issues.

Other small changes

This change includes a few small performance improvements:

Some clarity improvements:

MostlyArmless commented 11 months ago

Apologies for the messy diff, I think my IDE applied some whitespace adjustments I didn't realize. If you view the diffs in VS Code it should be easier to read.

Vinzent03 commented 6 months ago

Thanks for your contribution! I needed some time and fixed/changed some things, but this is now ready to go. :tada: