Page 1 of 1
Script works with filebot but not filebot fn:amc
Posted: 13 Jan 2017, 21:24
by MD500Pilot
I am trying to add all of this:
Code: Select all
/usr/bin/filebot -no-xattr -rename --db TheMovieDB -non-strict --log-file /root/filebot.log --format /mount/media/Movies/"{genres.contains('Comedy') ? 'Comedy' : genres.contains('Animation') ? 'Animation' : genres.contains('Science Fiction') ? 'Sci-Fi' : genres.contains('War') ? 'War' : genres.contains('Documentary') ? 'Documentary' : genres.contains('Fantasy') ? 'Fantasy': genres.contains('Sport') ? 'Sport': genres.contains('Horror') ? 'Horror': any{genre}{'NoGenre'}}/{n} ({y})/{n} ({y})" /mount/media/pre-process/*
to this:
Code: Select all
/usr/bin/filebot -script fn:amc -no-xattr -rename --db TheMovieDB -non-strict "/mount/media/pre-process" --log-file /root/filebot/filebot_amc.log --output "/mount/media" --def movieFormat="Movies/{any{genre}{'NoGenre'}} /{n} ({y})/{n} ({y}){' CD'+pi}{'.'+lang}" --def plex=10.200.50.2:XxxXxXxxXXxXX --def excludeList=/root/filebot/amc.txt
for the sole purpose of being able to let Plex know to update it's libraries. However no matter how much I try to add all of the additional categories it fails unless I pull them all the way back out.
Any help would be greatly appreciated.
Re: Script works with filebot but not filebot fn:amc
Posted: 13 Jan 2017, 21:42
by rednoah
1.
What exactly is not working? Screenshots.
Logs. Thx.
2.
I recommend using
@files for passing complex format expressions:
viewtopic.php?f=3&t=3244
Re: Script works with filebot but not filebot fn:amc
Posted: 13 Jan 2017, 23:58
by MD500Pilot
Here is the code:
Code: Select all
/usr/bin/filebot -script fn:amc -no-xattr -rename --db TheMovieDB -non-strict "/mount/media/pre-process" --log-file /root/filebot/filebot_amc.log --output "/mount/media" --def movieFormat="Movies/{genres.contains('Comedy') ? 'Comedy' : genres.contains('Animation') ? 'Animation' : genres.contains('Science Fiction') ? 'Sci-Fi' : genres.contains('War') ? 'War' : genres.contains('Documentary') ? 'Documentary' : genres.contains('Fantasy') ? 'Fantasy': genres.contains('Sport') ? 'Sport': genres.contains('Horror') ? 'Horror': {any{genre}{'NoGenre'}} /{n} ({y})/{n} ({y}){' CD'+pi}{'.'+lang}" --def plex=10.200.50.2:xxXxXXxXXXXX --def excludeList=/root/filebot/amc.txt
Here is the output:
Code: Select all
Locking /root/filebot/filebot_amc.log
Run script [fn:amc] at [Fri Jan 13 15:55:28 PST 2017]
Parameter: movieFormat = Movies/{genres.contains('Comedy') ? 'Comedy' : genres.contains('Animation') ? 'Animation' : genres.contains('Science Fiction') ? 'Sci-Fi' : genres.contains('War') ? 'War' : genres.contains('Documentary') ? 'Documentary' : genres.contains('Fantasy') ? 'Fantasy': genres.contains('Sport') ? 'Sport': genres.contains('Horror') ? 'Horror': {any{genre}{'NoGenre'}} /{n} ({y})/{n} ({y}){' CD'+pi}{'.'+lang}
Parameter: plex = *****
Parameter: excludeList = /root/filebot/amc.txt
Argument[0]: /mount/media/pre-process
Use excludes: /root/filebot/amc.txt (5)
Input: /mount/media/pre-process/12 Rounds (2009).mkv
Group: [mov:12 rounds 2009] => [12 Rounds (2009).mkv]
SyntaxError: missing token: }
Finished without processing any files
Failure (°_°)
Keeps saying:
I does not seem to matter where I try and add the } I cannot seem to make it work properly!
Re: Script works with filebot but not filebot fn:amc
Posted: 14 Jan 2017, 07:29
by rednoah
Please use the Format Editor. It'll help you with matching brackets.

Not using the Format Editor clearly results in you wasting your time, and then you wasting my time. So what's the point?

Why is it my job to count brackets for you? The error message is very clear. You open 10 {... brackets and you only close 9 ...} of them.
Re: Script works with filebot but not filebot fn:amc
Posted: 15 Jan 2017, 19:34
by MD500Pilot
This works fine with Format Editor on OSX:
Code: Select all
{genres.contains('Comedy') ? 'Comedy' : genres.contains('Animation') ? 'Animation' : genres.contains('Science Fiction') ? 'Sci-Fi' : genres.contains('War') ? 'War' : genres.contains('Documentary') ? 'Documentary' : genres.contains('Fantasy') ? 'Fantasy': genres.contains('Sport') ? 'Sport': genres.contains('Horror') ? 'Horror': {any{genre}{'NoGenre'}}} /{n} ({y})/{n} ({y}){' CD'+pi}
Code: Select all
Movie Format
Action/12 Rounds (2009)/12 Rounds (2009)
But still fails on the command line:
Code: Select all
Locking /root/filebot/filebot_amc.log
Run script [fn:amc] at [Sun Jan 15 11:29:44 PST 2017]
Parameter: movieFormat = Movies/{genres.contains('Comedy') ? 'Comedy' : genres.contains('Animation') ? 'Animation' : genres.contains('Science Fiction') ? 'Sci-Fi' : genres.contains('War') ? 'War' : genres.contains('Documentary') ? 'Documentary' : genres.contains('Fantasy') ? 'Fantasy': genres.contains('Sport') ? 'Sport': genres.contains('Horror') ? 'Horror': {any{genre}{'NoGenre'}}} /{n} ({y})/{n} ({y}){' CD'+pi}
Parameter: plex = *****
Parameter: excludeList = /root/filebot/amc.txt
Argument[0]: /mount/media/pre-process
Use excludes: /root/filebot/amc.txt (5)
Input: /mount/media/pre-process/12 Rounds.mkv
12 Rounds.mkv [series: pre process, movie: 12 Rounds (2009)]
Exclude Series: pre process
Group: [tvs:null, mov:12 rounds 2009] => [12 Rounds.mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/mount/media/pre-process/12 Rounds.mkv]
Stripping invalid characters from new path: Movies/Script5$_run_closure1@30bcf3c1 /12 Rounds (2009)/12 Rounds (2009)
[TEST] Rename [/mount/media/pre-process/12 Rounds.mkv] to [/mount/media/Movies/Script5$_run_closure1@30bcf3c1/12 Rounds (2009)/12 Rounds (2009).mkv]
Processed 1 files
Finished without processing any files
Failure (°_°)
Re: Script works with filebot but not filebot fn:amc
Posted: 15 Jan 2017, 20:08
by rednoah
Your format works for neither GUI nor CLI.
NO:
Code: Select all
{false ? null : {any{genre}{'NoGenre'}}}
YES:
Code: Select all
{false ? null : any{genre}{'NoGenre'}}
Re: Script works with filebot but not filebot fn:amc
Posted: 15 Jan 2017, 20:25
by MD500Pilot
hummm...it is actually working fine via GUI and has some kind of script error in CLI:
CLI error:
Code: Select all
/mount/media/Movies/Script5$_run_closure1@30bcf3c1
Re: Script works with filebot but not filebot fn:amc
Posted: 16 Jan 2017, 06:47
by rednoah
You're comparing apples and oranges. If you want to compare results, then you need to work with the same movie.
Avatar is a Science Fiction movie. The bug in your format only affects movies where the genre is not in your custom list of genres that you check beforehand.
i.e. Just because one code branch works, that doesn't mean that all other branches work:
Re: Script works with filebot but not filebot fn:amc
Posted: 16 Jan 2017, 19:07
by MD500Pilot
Understood - I will move the exact file over and test on it!
Thanks for the patience!
Re: Script works with filebot but not filebot fn:amc
Posted: 18 Jan 2017, 23:02
by MD500Pilot
rednoah -
Thank you for your patience:
OK, So I moved my media file (12 Rounds.mkv) to my local machine, went into filebot and went to options => edit format, then pasted this format into the expression box:
Code: Select all
{genres.contains('Comedy') ? 'Comedy' :
genres.contains('Animation') ? 'Animation' :
genres.contains('Science Fiction') ? 'Sci-Fi' :
genres.contains('War') ? 'War' :
genres.contains('Documentary') ? 'Documentary' :
genres.contains('Fantasy') ? 'Fantasy':
genres.contains('Sport') ? 'Sport':
genres.contains('Horror') ? 'Horror':
any{genre}{'NoGenre'}} /{n} ({y})/{n} ({y}){' CD'+pi}
Then selected "Change Sample", selected my sample (12 Rounds.mkv), selected Open Media Info and got the following:
But the info object never changes from the Avitar sample file:
So I clicked on "Use Bindings" and then "Use Format", selected my "12 Rounds.mkv" file as my original file and then matched it against the MovieDB and got this error:
Of course, I noticed that it is looking for 12 Rounds.mkv.mkv which does not exist, but then it gives me an option of selecting a video I think it might be:
If I add the year (12 Rounds (2009).mkv) then it immediately selects the correct movie and genre:
And it does so using the expression which you said was incorrect (the one that works on the GUI but not the command line). So I still at a loss. It appears to somewhat work from the GUI, but not at all from the command line:
Code: Select all
/mount/media/Movies/Script5$_run_closure1@30bcf3c1