Page 1 of 1

Feature Request: CLI interactive mode

Posted: 23 Nov 2016, 16:18
by Pator
It would be great to have a
-i
--interactive
for the cli
to be asked before any action is taken

Possibility 1 (when filebot has aleady the destination file name)
(yes/no)?
n would be like test mode
y like the real modes

Possibility 2 (when filebot decides to skip due to multiple matches)
Chosen match (1), 2, 3, 4?
giving the choice to choose one among multiple matches (maybe with 1 as default)

Possibility 1b)
(yes/no/edit)
Give the chance to edit/retouch the final filename at the prompt.

I achieve something similar with a bash script that calls filebot twice (and twice dB query). But it is extremely inefficient and slow

Re: Feature Request: CLI interactive mode

Posted: 23 Nov 2016, 16:27
by rednoah
--action test will give you non-interactive test mode. --q and --filter allow control matching. Running filebot repeatedly in test mode until it looks good is all the interaction you will need. FileBot does cache everything for a few days, so even if you call FileBot many times in a row it won't hit the database more than once.

You could easily build an interactive script around that though. As shell script it will indeed be a bit slow on older machines because it'll have to load Java/Groovy/FileBot multiple times, but this is not an issue if you write your interactive script in Groovy. This would definitely be something I'd merge into the repository.

Re: Feature Request: CLI interactive mode

Posted: 23 Nov 2016, 16:37
by Pator
--mode test
--mode move
I used them both in my script
(Calling filebot twice) for reviewing before an action is taken (-q need to check). So yes, all is loaded twice, and TMDB is queried twice... per file!!! So all this is multiplied by hundreds.

The goal is to mass rename with one by one review, all from within amc without reinventing the wheel

Re: Feature Request: CLI interactive mode

Posted: 23 Nov 2016, 16:55
by rednoah
You could run --action test and parse all the input/output mappings and then just call mv A B for the ones you OK, or if you want the amc script to do the move operations, then you can just call the amc script with the files you OKed instead of the whole folder.

Making both filebot -rename and the amc script is completely out of the question. Scripts can call other scripts (e.g. the amc script calls the artwork and cleaner scripts internally) so you could save startup time there, but it's complex and not meant to be used this way, so there'll probably be many unexpected issues.


PS: best to identify the aspects of the amc script that you actually need and prevent you from using simple -rename calls because using the amc script is probably not a good idea for what you're trying to do


EDIT:

I played with making an interactive Terminal UI:
https://gist.github.com/rednoah/931cf41 ... c40628ad56

If you're interested in coding, then you can look into that. I only made a simple UI for Show History / Revert Selected though.

Re: Feature Request: CLI interactive mode

Posted: 24 Nov 2016, 23:37
by rednoah
FileBot r4603 supports --mode interactive which will switch into console-interactive mode at certain key points were making a manual selection or confirmation might make sense.

@see viewtopic.php?f=3&t=4398

Code: Select all

--mode interactive
Image
Image