Script not working as i thought....

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
stuartgreig1978
Posts: 6
Joined: 28 Jan 2015, 00:59

Script not working as i thought....

Post by stuartgreig1978 »

filebot -script fn:amc --output "M:\Video" --log-file amc.log --action copy --conflict override -non-strict --def music=n subtitles=en artwork=y xbmc=localhost "movieFormat={fn =~ /3D/ ? '3D Movies' : 'Movies'}/{n.space('.')}.({y}){fn =~ /3D/ ? '.3D.Bluray' : ''}/{n.space('.')}.({y}).({hpi}){fn =~ /3D/ ? '3D.Bluray' : ''}{' CD'+pi}" deleteAfterExtract=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"

At the moment it partially does what i want it to. When i download a 3D movies it automatically downloads the 3D movies to the "3D Movies" folder and names them correctly the rest of the downloads go to the "Movies" folder. Just checked my movies folder and the 2D moves aren't being named correctly. At present for example i have:-

Rocky.Balboa.(2006).
Scarface.(1983).

Ideally i would want:-

Rocky.Balboa.[1080p].(2006).Bluray
Scarface.[1080p].(1983).Bluray

Also if possible if i download a family/kids movie can they be moved to a "Kids Movies" folder with the files name in the same format as above?

Anyone Help??
User avatar
rednoah
The Source
Posts: 23949
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working as i thought....

Post by rednoah »

You will find answers for all your queries in other posts. It's simple once you understand how the format works. ;)
:idea: Please read the FAQ and How to Request Help.
stuartgreig1978
Posts: 6
Joined: 28 Jan 2015, 00:59

Re: Script not working as i thought....

Post by stuartgreig1978 »

Thanks. Still struggling though even after I've tried understanding the code???
User avatar
rednoah
The Source
Posts: 23949
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working as i thought....

Post by rednoah »

Code: Select all

{fn =~ /3D/ ? '.3D.Bluray' : ''}
This part only works if the original filename {fn} contains the String '3D'

Code: Select all

.({hpi})
This is a typical noob mistake. It works but it's not robust.

@see viewtopic.php?f=5&t=1895
Thanks. Still struggling though even after I've tried understanding the code???
So what seems to be the problem?
:idea: Please read the FAQ and How to Request Help.
stuartgreig1978
Posts: 6
Joined: 28 Jan 2015, 00:59

Re: Script not working as i thought....

Post by stuartgreig1978 »

My problem isn't really with the 3D files. They rename correctly and go into the correct folder no problem. My issues is with the renaming of the 2D files. At present for example I have The.Dark.Knight.(2008.().mkv

I want it to look like this The.Dark.Knight.(2008).(Bluray).mkv.

I cant seem to find the part of my script that deals with renaming the 2D files and inserting the Bluray inside the ()??

Any ideas?
User avatar
rednoah
The Source
Posts: 23949
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working as i thought....

Post by rednoah »

Code: Select all

.({hpi})
What happens if {hpi} fails? Yes, the result is ".()" like what you're seeing.

The link I posted does explain this problem in detail and will explain how to write formats that deal with failures correctly.
:idea: Please read the FAQ and How to Request Help.
Post Reply