Skip to content

High performance self-hosted photo and video management solution.

feat: workflow filter assets by upload path (#30000)

Ben Beckford12fc8bac183f
diff --git a/packages/plugin-core/manifest.json b/packages/plugin-core/manifest.json
index 66a12c36f2..d55ad43e70 100644
--- a/packages/plugin-core/manifest.json
+++ b/packages/plugin-core/manifest.json
@@ -103,6 +103,12 @@
"default": false,
"title": "Case sensitive",
"description": "Whether matching should be case-sensitive"
+ },
+ "usePath": {
+ "type": "boolean",
+ "default": false,
+ "title": "Use path",
+ "description": "Match the full path on the server instead of the original filename"
}
},
"required": ["pattern"]
diff --git a/packages/plugin-core/src/index.ts b/packages/plugin-core/src/index.ts
index 5dc358a2f0..d412ad7708 100644
--- a/packages/plugin-core/src/index.ts
+++ b/packages/plugin-core/src/index.ts
@@ -54,11 +54,11 @@ const methods = wrapper<Manifest>({
},
assetFileFilter: ({ data, config }) => {
- const { pattern, matchType = 'contains', caseSensitive = false } = config;
+ const { pattern, matchType = 'contains', caseSensitive = false, usePath = false } = config;
const { asset } = data;
- const fileName = asset.originalFileName || '';
+ const fileName = usePath ? asset.originalPath : asset.originalFileName;
const searchName = caseSensitive ? fileName : fileName.toLowerCase();
const searchPattern = caseSensitive ? pattern : pattern.toLowerCase();