mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
feat: workflow filter assets by upload path (#30000)
Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>
This commit is contained in:
parent
f2c00c107d
commit
12fc8bac18
2 changed files with 8 additions and 2 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue