Page 1 of 1

Part index variable in CLI

Posted: 18 Apr 2013, 20:31
by andersonshatch
I want a conditional ", Part n" on my movie format if there are likely more than 1 parts.

I've set my format up as this: /Volumes/Macintosh HD/MoviesTest/{n} ({y}){(pi == null ? '' : ", Part $pi")}
And it works fine in the GUI (see screenshot)
Screen Shot 2013-04-18 at 21.19.39.png
But in the CLI the part index is not set to anything, but it isn't null either. Bug? Me doing something wrong?

> filebot --db IMDb --action test --format "/Volumes/pool-TEST/Movies/{n} ({y}){(pi == null ? '' : \", Part $pi\")}" -rename Iron.Man* -non-strict
Rename movies using [IMDb]
Auto-detect movie from context: [/Users/josh/Iron.Man.CD1.avi]
Auto-detect movie from context: [/Users/josh/Iron.Man.CD2.avi]
[TEST] Rename [/Users/josh/Iron.Man.CD1.avi] to [/Volumes/pool-TEST/Movies/Iron Man (2008), Part .avi]
[TEST] Rename [/Users/josh/Iron.Man.CD2.avi] to [/Volumes/pool-TEST/Movies/Iron Man (2008), Part .avi]
Processed 2 files
Done ?(?????)?

Re: Part index variable in CLI

Posted: 19 Apr 2013, 08:21
by rednoah
Try with default movie format and it works:

Code: Select all

Parameter: ut_kind = multi
Parameter: ut_dir = D:\testdata\AMC-TEST
Parameter: ut_title = AMC-TEST
Input: D:\testdata\AMC-TEST\Iron.Man.CD1.avi
Input: D:\testdata\AMC-TEST\Iron.Man.CD2.avi
Iron.Man.CD1.avi [series: Iron Man, movie: Iron Man (2008)]
Exclude Series: Iron Man
Iron.Man.CD2.avi [series: Iron Man, movie: Iron Man (2008)]
Exclude Series: Iron Man
Group: [tvs:null, mov:Iron Man (2008), anime:null] => [Iron.Man.CD1.avi, Iron.Man.CD2.avi]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [D:\testdata\AMC-TEST\Iron.Man.CD1.avi]
Auto-detect movie from context: [D:\testdata\AMC-TEST\Iron.Man.CD2.avi]
[COPY] Rename [D:\testdata\AMC-TEST\Iron.Man.CD1.avi] to [D:\output\Movies\Iron Man (2008)\Iron Man (2008) CD1.avi]
[COPY] Rename [D:\testdata\AMC-TEST\Iron.Man.CD2.avi] to [D:\output\Movies\Iron Man (2008)\Iron Man (2008) CD2.avi]
Processed 2 files
Done ヾ(@⌒ー⌒@)ノ
Can't see any major issues on first sight though.

Btw if you call a binding that is undefined it'll break the whole {expression}. So if pi is null, it'll not even get to null check but unwind the {expression} immediately.

EDIT: Maybe a simple -rename call doesn't work. If you already got things folder by folder try the fn:renall script.

EDIT2: Tested with simple -rename option and works as well:

Code: Select all

Rename movies using [IMDb]
Auto-detect movie from context: [D:\testdata\AMC-TEST\Iron.Man.CD1.avi]
Auto-detect movie from context: [D:\testdata\AMC-TEST\Iron.Man.CD2.avi]
[TEST] Rename [D:\testdata\AMC-TEST\Iron.Man.CD1.avi] to [Iron Man (2008), Part 1.avi]
[TEST] Rename [D:\testdata\AMC-TEST\Iron.Man.CD2.avi] to [Iron Man (2008), Part 2.avi]
Processed 2 files
Done ヾ(@⌒ー⌒@)ノ
EDIT3: Since everything seems to work just fine. I assume your format is somehow broken. Or gets broken by the console when passing arguments, leading to syntax errors in the expression, leading to the expression always failing.