Possible to ignore directories within the org-directory?

The tool that I use to sync my org directory sometimes will store old revisions of modified files into a .directory within my org directory root. When org-roam finds these it gives me lots of issues as they are duplicates of files in the main org directory (by id). Is there a property to have org-roam ignore this specific subdirectory?

I believe you can use one of these options in the manual. My guess would be that you can have a custom function to exclude files if they are part of .directory with using org-roam-db-node-include-function and something like `file-in-directory-p. See the example in the manual.

For this case, org-roam-file-exclude-regexp, which is referenced by org-roam-file-p, is probably a better option than org-roam-db-node-include-function, which is referenced by org-roam-db-node-p. It’s missing from the manual at the moment. Including the full path to the subdirectory in the regular expression should work:

(setq org-roam-file-exclude-regexp
      (concat "^" (expand-file-name org-roam-directory) "/exclude-this-subdir/")