Page 1 of 1

Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 19 Oct 2019, 21:18
by DevXen
Maybe an option or a separate mini program to convert my GUI script to a CLI Script. also maybe allow it to switch between Windows CLI and Linux CLI.

I just recently installed unraid and i get the feeling a CLI version of my scripts would be much more useful. but my scripts haven't very easily translated over to a workable CLI. - so a small converter would be awesome.


Thanks,
-Dev

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 01:29
by rednoah
1.
By "GUI scripts", do you mean format expressions? or Presets? or something else?


2.
What exactly is giving you a hard time? Where are you stuck?

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 01:36
by DevXen
I meant format expressions. I haven't tried to do it in a while but when I took my format expressions and moved it to the filebot docker on unRAID it had several errors so I actually installed a windows 10 VM on it just to use filebot cause of that issue.


And presets? What? How did I not know that was a thing. I was looking at the post you linked. I think that might come in pretty useful.

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 01:41
by rednoah
Well, in that case it's just copy & paste:

1. Open FileBot Format Editor ➔ CTRL+A / CTRL+C
2. Open a text editor ➔ CTRL+V ➔ Save as MyMovieFormat.groovy
3. Call filebot with --format /path/to/MyMovieFormat.groovy


:idea: You can also just use /path/to/MyMovieFormat.groovy as format in the Format Editor, if you prefer editing your format via your preferred code editor.

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 01:46
by DevXen
I think the problem with the Linux was the format of the expression since I use many csv files for checks and changes. I would assume they paths of those were an issue but I'm not sure. I just know when I tried to paste it as a cki it didn't like it.

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 01:49
by rednoah
DevXen wrote: 20 Oct 2019, 01:46 I use many csv files.
Well, this requirement effectively makes the OP impossible, since you'd probably have modify the absolute file paths and make them point to corresponding files on the Linux machine.

In this case, having a single very large *.groovy format file that includes both format code and related csv data, and use that in both GUI and CLI, might be a good idea.

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 02:22
by DevXen
Oh my csv files are all in the same place. So changing the relative path for Linux shouldn't be a problem. I was thinking there were other os specific issues I'll try it again and see exactly what it does when I can.

Also didn't know I could put the csv data in a groovy file. Though that might make it more difficult to update. It might definitely be worth looking into. Thank you.

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 02:26
by rednoah
Well, the csv function gives you a Map object, so you can of course define the same Map object in code directly as well.


:idea: If you use groovy files, there's no longer a 8K format length limit either.

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 02:33
by DevXen
I didn't know there was a format format length.
Groovy is sounding better. So in theory I should be able to copy my format to. Groovy file. And fix the csv paths and it should work either with the gui or the cli in unraid? Or would that be just for the cli?

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 02:42
by rednoah
It'll work for all instances of FileBot. Internally, it's the same engine that evaluates your format expressions, and works the same on all platforms.

Re: Feature Request: Script Converter between GUI/CLI and Windows/Linux versions.

Posted: 20 Oct 2019, 02:44
by DevXen
Awesome I'll mess with that tomorrow. See what I can do. I appreciate all your help.