Submit watch folder path from WebInterface

Questions and answers on how to get the most out of FFAStrans
Post Reply
CPowerMav
Posts: 4
Joined: Thu Sep 01, 2022 1:12 pm

Submit watch folder path from WebInterface

Post by CPowerMav »

Hello everyone! 1st, thank you for this software. It's going to save me boatloads of time once I develop my workflows correctly.

Question:
I have a workflow that transcodes proxies (ProRes files) from source videos. Currently It's setup just as a simple watch folder with some parameters for filtering. It works when I manually input the path in the node and "start" the workflow from the windows UI. I would like to be able to change the watch folder path from the WebUI so any editor/producer can activate the proxy generation workflow themselves by entering the path to the source files. They often have recursive directories so the watch folder node works well for this.

I can't figure out how to get the WebUI to change the watch folder path! I tried setting user variables, and tested it with a text file output so the webui works for populating the variable, but there's no way that I'm aware of to populate that variable and set that as the watch folder path without submitting a single file through the WebUI which then just processes the one file.

Help is appreciated. Thank you!
emcodem
Posts: 1651
Joined: Wed Sep 19, 2018 8:11 am

Re: Submit watch folder path from WebInterface

Post by emcodem »

Hey CPowerMav,
welcome to the forum and thank you for using FFAStrans!

Your approach to "dynamically change watchfolders" is not a valid usecase currently. Watchfolders are designed as a pretty static thing, e.g. only change when the system administrator changes them.
In the case of user file submission, the usual design is that the user just selects the folder or files he wants to process and submits a job.

So you say a user selects a path and you want to process all files in it recursively? In that case i propose a workflow like this.
Before you start, install the custom processor "Files Find" from here:
https://ffastrans.com/wiki/doku.php?id= ... processors

Here is your workflow
emcodem_folder_recurse.json
(7.97 KiB) Downloaded 59 times
How to use:
In the webui job starter interface, just submit a folder instead of a file to the workflow.

Let me know if it works for you.
emcodem, wrapping since 2009 you got the rhyme?
CPowerMav
Posts: 4
Joined: Thu Sep 01, 2022 1:12 pm

Re: Submit watch folder path from WebInterface

Post by CPowerMav »

Wow that was fast! I will try this and report back. Thank you!
CPowerMav
Posts: 4
Joined: Thu Sep 01, 2022 1:12 pm

Re: Submit watch folder path from WebInterface

Post by CPowerMav »

I took some time to dig into the workflow you created. I got it close however I'm trying to save the generated files at the end of the workflow to a /Proxy folder relative to each file. This current workflow strips the path that precedes it using the regex. I can't figure out how to use regex to do similarly by stripping the filename and storing just the path so I can assemble it at the end of the workflow. Your help is appreciated!

Thank you kindly.
CPowerMav
Posts: 4
Joined: Thu Sep 01, 2022 1:12 pm

Re: Submit watch folder path from WebInterface

Post by CPowerMav »

I was able to do it with this:
$regreplace("%s_source%", '[^\\/]*$', '')
Which removes the filename but leaves the full path.
emcodem
Posts: 1651
Joined: Wed Sep 19, 2018 8:11 am

Re: Submit watch folder path from WebInterface

Post by emcodem »

Hehe well done my friend, congrats :D
Just to let you know, creating branches dynamically with foreach and sub-workflow node stuff is pretty new to ffastrans and it kind of automatically introduces working with different sources in a single job with it, we are discussing internally ways to make users life easier in future when working with multiple files. So that is the reason why you currently gotta use regex.

I hope all the files in the submitted folder are already static and complete, otherwise we'd probably need to change to your original approach registering dynamically watchfolders but that would also bring the need to de-register watches once they are not needed anymore and such, so not the easiest approach...
emcodem, wrapping since 2009 you got the rhyme?
Post Reply