Command line result different from GUI result

All your suggestions, requests and ideas for future development
Post Reply
marink
Posts: 2
Joined: 18 Feb 2015, 22:50

Command line result different from GUI result

Post by marink »

Hi there,

So I'm using the exact same code on the same version of filebot in both the GUI and command line, except when I run the command line I get a different result, I think it probably stems back to trying to run n.replaceFirst on it, and moving the "The" to the back of the filename, the script I run by command line is:

filebot -script fn:amc --log-file amc.log --action duplicate --conflict override -non-strict "../media" --def "seriesFormat=..media/tv-shows/{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)}/{'Season '+s.pad(2)}/{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} - {s00e00} - {t} ({vf})" "movieFormat=../movies/{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} ({y})/{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} ({y}) ({vf})" excludeList=../amc.txt music=n artwork=n plex=host

and in the GUI I have the series script set to:

../tv-shows/{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)}/{'Season '+s.pad(2)}/{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} - {s00e00} - {t} ({vf})

I've included the logs from the GUI and the command line below, any help to uncover what the problem is would be much appreciated, everything else works fine apart from when I try to rename series that begin with "The".

I'm running filebot v4.5.6 on Lubuntu if that helps.

----------------------------

<sequence date="2015-02-18T22:43:27.355Z">
<rename dir="../media/The.ExampleShow.2014.S03E12.720p.HDTV.X264-DIMENSION[rarbg]" from="The.ExampleShow.2014.S03E12.720p.HDTV.X264-DIMENSION.mkv" to="../media/tv-shows/Example Show, The/Season 01/Example Show, The - S03E12- Show Title(720p).mkv"/>
</sequence>

----------------------------

Input: ../media/The.ExampleShow.2014.S03E12.720p.HDTV.X264-DIMENSION[rarbg]/The.ExampleShow.2014.S03E12.720p.HDTV.X264-DIMENSION.mkv
Group: [tvs:the example show] => [The.ExampleShow.2014.S03E12.720p.HDTV.X264-DIMENSION.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [The Example Show]
Fetching episode data for [The Example Show]
[DUPLICATE] Rename [../media/The.ExampleShow.2014.S01E14.720p.HDTV.X264-DIMENSION[rarbg]/The.ExampleShow.2014.S03E124.720p.HDTV.X264-DIMENSION.mkv] to [../media/tv-shows/The.ExampleShow.2014.S03E124.720p.HDTV.X264-DIMENSION[rarbg], 0a8d123c6e9945df724d3cd557e61d1e2f/Season 01/The.ExampleShow.2014.S03E124.720p.HDTV.X264-DIMENSION[rarbg], 0a8d123c6e9945df724d3cd557e61d1e2f - S03E12- Show Title(720p).mkv]

-------------------------------------------

Thanks,
Marink
User avatar
rednoah
The Source
Posts: 23931
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Command line result different from GUI result

Post by rednoah »

Think about what you're actually passing in. If you use "..." quotes then the shell will resolve all the $variables so what you think you're passing isn't actually what you're passing along. ;)

So... don't use $ if you don't know what it means. In your case using sortName() would be the much cleaner solution anyway.
:idea: Please read the FAQ and How to Request Help.
marink
Posts: 2
Joined: 18 Feb 2015, 22:50

Re: Command line result different from GUI result

Post by marink »

That worked perfectly, sorry I completely forgot about it running differently inside the command line, thanks rednoah!
Post Reply