From b272febfa0c5562e993d24abe5d21ab18cb7c313 Mon Sep 17 00:00:00 2001 From: travish Date: Wed, 3 Dec 2025 09:13:46 -0600 Subject: [PATCH 1/3] feat: add ignored directories textarea to define ignoredPaths --- src/Setting.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Setting.ts b/src/Setting.ts index 545b096..472ce17 100644 --- a/src/Setting.ts +++ b/src/Setting.ts @@ -39,6 +39,25 @@ export class BinaryFileManagerSettingTab extends PluginSettingTab { }); }); + new Setting(containerEl) + .setName('Ignored directories') + .setDesc( + 'Directory paths to ignore during auto detection. One path per line. Wildcards supported (e.g., archives/*, *inbox)' + ) + .addTextArea((textArea) => { + textArea + .setPlaceholder('archives/*\n*inbox\ntemp/') + .setValue(this.plugin.settings.ignoredPaths.join('\n')) + .onChange(async (value: string) => { + this.plugin.settings.ignoredPaths = value + .split('\n') + .map((path) => path.trim()) + .filter((path) => path.length > 0); + await this.plugin.saveSettings(); + }); + textArea.inputEl.rows = 4; + }); + new Setting(containerEl) .setName('New file location') .setDesc('New metadata file will be placed here') From f9849e2d372342ce87a05365f9d957c8979d6b34 Mon Sep 17 00:00:00 2001 From: travish Date: Wed, 3 Dec 2025 09:14:17 -0600 Subject: [PATCH 2/3] feat: implement logic to ignore vault paths from autoDetection --- src/main.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/main.ts b/src/main.ts index 523eb7c..951fdfc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,6 +12,7 @@ interface BinaryFileManagerSettings { filenameFormat: string; templatePath: string; useTemplater: boolean; + ignoredPaths: string[]; } const DEFAULT_SETTINGS: BinaryFileManagerSettings = { @@ -39,6 +40,7 @@ const DEFAULT_SETTINGS: BinaryFileManagerSettings = { filenameFormat: 'INFO_{{NAME}}_{{EXTENSION:UP}}', templatePath: '', useTemplater: false, + ignoredPaths: [], }; export default class BinaryFileManagerPlugin extends Plugin { @@ -69,6 +71,11 @@ export default class BinaryFileManagerPlugin extends Plugin { return; } + // Check if the file path should be ignored during auto detection + if (this.isPathIgnored(file.path)) { + return; + } + await this.metaDataGenerator.create(file as TFile); new Notice(`Metadata file of ${file.name} is created.`); this.fileListAdapter.add(file.path); @@ -148,6 +155,36 @@ export default class BinaryFileManagerPlugin extends Plugin { // onunload() {} + private isPathIgnored(filePath: string): boolean { + if (this.settings.ignoredPaths.length === 0) { + return false; + } + + for (const ignoredPath of this.settings.ignoredPaths) { + const trimmedPath = ignoredPath.trim(); + if (trimmedPath === '') { + continue; + } + + // Convert glob pattern to regex + const regexPattern = trimmedPath + .replace(/\*/g, '.*') + .replace(/\?/g, '.'); + + const regex = new RegExp(`^${regexPattern}(?:/|$)`); + + // Check if the file path or its parent directory matches the pattern + if ( + regex.test(filePath) || + regex.test(filePath.split('/').slice(0, -1).join('/')) + ) { + return true; + } + } + + return false; + } + async loadSettings() { this.settings = Object.assign( {}, From b4b55f5d006b19d447433324b95b7b5e2f5df151 Mon Sep 17 00:00:00 2001 From: travish Date: Thu, 28 May 2026 20:43:24 -0500 Subject: [PATCH 3/3] feat: implement ignore vault paths from manual, unlinked detection --- src/main.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.ts b/src/main.ts index 951fdfc..8256118 100644 --- a/src/main.ts +++ b/src/main.ts @@ -109,6 +109,11 @@ export default class BinaryFileManagerPlugin extends Plugin { continue; } + // Check if the file path should be ignored during manual detection + if (this.isPathIgnored(file.path)) { + return; + } + promises.push( this.metaDataGenerator .create(file as TFile) @@ -133,6 +138,10 @@ export default class BinaryFileManagerPlugin extends Plugin { const unlinkedFiles = this.metaDataGenerator.findUnlinkedBinaries(); unlinkedFiles.forEach((file) => { + // Check if the file path should be ignored during unlinked detection + if (this.isPathIgnored(file.path)) { + return; + } promises.push( this.metaDataGenerator .create(file as TFile)