.sub and .idx files moved to incorrect location

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

.sub and .idx files moved to incorrect location

Post by CHA0SENG7NE »

Hi
I'm totally stuck with renaming locations of just the .idx and .sub files included with a movie
Any help appreciated....

The .idx and .sub file is saved into \\192.168.0.150/Multimedia/Movies/

Not into the correct location \\192.168.0.150/Multimedia/Movies/Movies/

All the rest of the artwork and movie works just fine.

utorrent call code:

Code: Select all

filebot -script fn:amc --output "\\192.168.0.150/Multimedia/Movies/Movies" --action move --conflict skip -non-strict --def movieFormat=@"C:\Filebot Templates\movie.groovy" seriesFormat=@"C:\Filebot Templates\series.groovy" --def artwork=y --def unsorted=yes --def subtitles=en --def extras=y  --def clean=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
groovy files


movie

Code: Select all

\\192.168.0.150\Multimedia/Movies/{f =~ /(?i)3D|3\.D|3\-D/ ? '3D Movies' : vf =~ /2160p/ ? '4K Movies' : 'Movies'}/{norm = {it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ").replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower() })}; norm(n)}{if (norm(n) != norm(primaryTitle)) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y}) [{director}]  [{imdbid}]/{norm(n)} ({y}){fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}{" Part $pi"}{" [$vf $vc "}{hdr} {
def best = any{audio.max{it.StreamSize.toInteger()}}{ audio.max{it.BitRate.replaceAll(/Unknown\s?\/\s?/).split(' / ')*.toInteger().max()}}{null};
def ChannelString = any{(best.'ChannelPositionsString2'.replaceAll(/Object\sBased\s\/|(\d+)?\sobjects\s\/|0.(?=\d.\d)/, '').split(' / ').collect{ it.split('/')*.toDouble().sum() }.max()).toString()}{null};
def audioCodec = (ac == 'MP3'||ac == 'AAC') ? ac : any{best.FormatProfile ? (best.Codec+'.'+best.FormatProfile.replaceAll(/\s?\/.*|E-AC-3\+|TrueHD|AC3|Matrix/)).replaceAll(/\.\+|\+\./, '+').replaceAll(/\.$/).replaceAll(/DTS\./, 'DTS-') : null}{best.Codec}{aco}{ac}{'ERROR'};
allOf{audioCodec}{any{ChannelString}{channels}}.join(' ');}] {[source]} [{runtime}mins]
tv show

Code: Select all

\\192.168.0.150\Multimedia\{kodi}{" Part $pi"}{" [$vf $vc "}{hdr} {
def best = any{audio.max{it.StreamSize.toInteger()}}{ audio.max{it.BitRate.replaceAll(/Unknown\s?\/\s?/).split(' / ')*.toInteger().max()}}{null};
def ChannelString = any{(best.'ChannelPositionsString2'.replaceAll(/Object\sBased\s\/|(\d+)?\sobjects\s\/|0.(?=\d.\d)/, '').split(' / ').collect{ it.split('/')*.toDouble().sum() }.max()).toString()}{null};
def audioCodec = (ac == 'MP3'||ac == 'AAC') ? ac : any{best.FormatProfile ? (best.Codec+'.'+best.FormatProfile.replaceAll(/\s?\/.*|E-AC-3\+|TrueHD|AC3|Matrix/)).replaceAll(/\.\+|\+\./, '+').replaceAll(/\.$/).replaceAll(/DTS\./, 'DTS-') : null}{best.Codec}{aco}{ac}{'ERROR'};
allOf{audioCodec}{any{ChannelString}{channels}}.join(' ');}] {[source]} [{runtime}mins]
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: .sub and .idx files moved to incorrect location

Post by rednoah »

Presumably, certain sections of the format fail for some reason when when being evaluated on the sub/idx files for some reason.

I recommend using the Format Editor GUI to debug custom formats:
https://www.filebot.net/naming.html

:arrow: I'd start by narrowing down which specific section of your code doesn't work as expected for sub/idx files.
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: .sub and .idx files moved to incorrect location

Post by CHA0SENG7NE »

Hi Rednoah,
The .idx and .sub are named correctly just not in the correct location.
Is this a naming format problem, not something easier such as the utorrent program call text?
Ill have a good read and see if I canspot the problem, TV shows and Movies all work perfectly, its just the idx and sub are put in there own folder???

Thank you
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: .sub and .idx files moved to incorrect location

Post by rednoah »

If the files are put into a different folder, then it means your format evaluated to a different file path, except not the one you thought it would.


If you want to save yourself the trouble, but not have any customizations, then you can just stick with one of the built-in default formats:

Code: Select all

{plex}
:arrow: viewtopic.php?f=5&t=4116
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: .sub and .idx files moved to incorrect location

Post by CHA0SENG7NE »

Thank you, just reading through a new (I think) binding of {aco} now accounts for dolby atmos....

I do like the custom format and I will live with the problem for now. I use the {kodi} for tv shows

If I use the {kodi} for movies can I still have different movies types i.e 4k HD and 3d go into their separate locations? as shown in my groovy files
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: .sub and .idx files moved to incorrect location

Post by rednoah »

You can use bits and pieces, e.g.

Code: Select all

{kodi.tail}

Code: Select all

{kodi.name}
:arrow: viewtopic.php?f=5&t=4116
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: .sub and .idx files moved to incorrect location

Post by CHA0SENG7NE »

Thanks
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: .sub and .idx files moved to incorrect location

Post by CHA0SENG7NE »

Hi Rednoah
Just an update. The problem is now fixed.
I switched my naming scheme to {kodi.name} Keeping the 3d,4k and standard movie folders.
The .sub and .idx correctly relocate into movie folder.

Thank you
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: .sub and .idx files moved to incorrect location

Post by rednoah »

Good to know. Thanks for reporting back. :)
:idea: Please read the FAQ and How to Request Help.
Post Reply