[SOLVED] CLI renaming problem in v4.0

All your suggestions, requests and ideas for future development
Post Reply
minimeh
Posts: 4
Joined: 14 Aug 2013, 18:40

[SOLVED] CLI renaming problem in v4.0

Post by minimeh »

I have a formatting string that I have used with the CLI with v3.x that now is not with v4.0. Yet, when I plug the format string into the GUI, it works as intended.

Given the file name:

Code: Select all

The.Daily.Show.with.Jon.Stewart.2013.08.12.Sen.Rand.Paul.720p.HDTV.x264-LMAO.mkv
The following command

Code: Select all

filebot -rename -non-strict --db tvrage "Z:\Media\dailycolbert\test\The Daily Show\The.Daily.Show.with.Jon.Stewart.2013.08.12.Sen.Rand.Paul.720p.HDTV.x264-LMAO.mkv" --format "{n.upperInitial().space('.')}.{airdate.format("yyy.MM.dd")}-{t}"
returns

Code: Select all

The.Daily.Show.With.Jon.Stewart.-Rand Paul.mkv
However in the GUI, if I change the format string to

Code: Select all

{n.upperInitial().space('.')}.{airdate.format("yyy.MM.dd")}-{t}
the file name returned is what is intended:

Code: Select all

The.Daily.Show.With.Jon.Stewart.2013.08.12-Sen. Rand Paul.mkv
Is this a bug?

Thanks.
Last edited by minimeh on 11 Mar 2014, 17:48, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CLI renaming problem in v4.0

Post by rednoah »

It's a bug in your cmdline call alright.

Read the FAQ. There's an entry specifically for people who need to learn how to correctly pass cmdline arguments and cmdline escaping. ;)
:idea: Please read the FAQ and How to Request Help.
minimeh
Posts: 4
Joined: 14 Aug 2013, 18:40

Re: CLI renaming problem in v4.0

Post by minimeh »

Oh, that. Right. Oops.

For those who wonder, in a DOS command line, the quotes in the format argument need to be escaped so that they will be passed on to FileBot, thusly:

Code: Select all

filebot -rename -non-strict --db tvrage "Z:\Media\dailycolbert\test\The Daily Show\The.Daily.Show.with.Jon.Stewart.2013.08.12.Sen.Rand.Paul.720p.HDTV.x264-LMAO.mkv" --format \"{n.upperInitial().space('.')}.{airdate.format(\"yyy.MM.dd\")}-{t}\"
In my defense, it is a command line that I pass using python, not directly from the console Here I was just doing a quick and dirty test without running the python script.

Thanks rednoah and sorry for the bother.
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SOLVED] CLI renaming problem in v4.0

Post by rednoah »

The leading/trailing quotes don't need to be escaped though. I think in this case it only works cause it's the last argument.

I'd just write it like this, using single quotes:

Code: Select all

filebot -rename -non-strict --db tvrage "Z:\Media\dailycolbert\test\The Daily Show\The.Daily.Show.with.Jon.Stewart.2013.08.12.Sen.Rand.Paul.720p.HDTV.x264-LMAO.mkv" --format "{n.upperInitial().space('.')}.{airdate.format('yyy.MM.dd')}-{t}"
Of course you can ignore all that if you pass in arguments String Array with proper languages. :)
:idea: Please read the FAQ and How to Request Help.
minimeh
Posts: 4
Joined: 14 Aug 2013, 18:40

Re: [SOLVED] CLI renaming problem in v4.0

Post by minimeh »

All good to know in case of future quick and dirty tests! (Unless of course I forget again)
:-)
Post Reply