Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export class MetaDataGenerator {
if (!(file instanceof TFile)) {
return false;
}
if (
!file.path.startsWith(
normalizePath(this.plugin.settings.binaryFilePath)
)
) {
return false;
}

const matchedExtension =
this.plugin.fileExtensionManager.getExtensionMatchedBest(file.name);
Expand Down
14 changes: 14 additions & 0 deletions src/Setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ export class BinaryFileManagerSettingTab extends PluginSettingTab {
});
});

new Setting(containerEl)
.setName('Binary file parent folder')
.setDesc('Only this folder will be watched for new files')
.addSearch((component) => {
new FolderSuggest(this.app, component.inputEl);
component
.setPlaceholder('Example: folder1/folder2')
.setValue(this.plugin.settings.binaryFilePath)
.onChange((newFolder) => {
this.plugin.settings.binaryFilePath = newFolder;
this.plugin.saveSettings();
});
});

let extensionToBeAdded: string;
new Setting(containerEl)
.setName('Extension to be watched')
Expand Down
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface BinaryFileManagerSettings {
autoDetection: boolean;
extensions: string[];
folder: string;
binaryFilePath: string;
filenameFormat: string;
templatePath: string;
useTemplater: boolean;
Expand Down Expand Up @@ -36,6 +37,7 @@ const DEFAULT_SETTINGS: BinaryFileManagerSettings = {
'pdf',
],
folder: '/',
binaryFilePath: '/',
filenameFormat: 'INFO_{{NAME}}_{{EXTENSION:UP}}',
templatePath: '',
useTemplater: false,
Expand Down