Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow: filter based on file path #22976

Closed
martin-rueegg opened this issue Sep 20, 2020 · 3 comments
Closed

Workflow: filter based on file path #22976

martin-rueegg opened this issue Sep 20, 2020 · 3 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement

Comments

@martin-rueegg
Copy link
Contributor

martin-rueegg commented Sep 20, 2020

Situation

Context

When creating (work)flows, there are different filters that can be used in a rule, e.g. file name or file size, etc. However, there is no filtering possible on file path.

Use case

For example, on my mobile phone I upload pictures with AutoUpload to a specific folder on the server. Now I want to downsize all those pictures into another folder and saving the original in a different folder again, leaving the upload folder empty. I have a script for that. All I need to do is running that script whenever a new file is uploaded or moved into that folder.

Alternative?

While I can use a RegEx for example to match on the file extension (using the File name-filter), I cannot do the same for the path, as that information is not available (been cut off by basename()).

Solution

I have created a solution that works on NC17 (but needs review and might need some tweaks) and am now struggling to get it working on NC18+ (testing with 19.0.2). The main issue is, that while I have the filter in place, I don't manage to get it in the frontend into the list of available filters.

Help needed

Help on finalizing the patch would be great so that I can open a PR (guidance on the latter will also be appreciated once everything is ready).

PS: happy to provide a filter for #5330 as well, although I don't really see the use case on that.... :-)


Code

NC17

I haven't included the compiled version of workflowengine.js in order to keep merging simple. Please run make first.

master

@martin-rueegg martin-rueegg added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Sep 20, 2020
@martin-rueegg
Copy link
Contributor Author

Ping @juliushaertl, @blizzz

@martin-rueegg

This comment has been minimized.

@kesselb
Copy link
Contributor

kesselb commented Nov 28, 2020

Duplicate of #19810

@kesselb kesselb marked this as a duplicate of #19810 Nov 28, 2020
@kesselb kesselb closed this as completed Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement
Projects
None yet
Development

No branches or pull requests

2 participants