Detailed source binding

All your suggestions, requests and ideas for future development
Post Reply
TehBotol
Supporter
Posts: 34
Joined: 06 Mar 2013, 00:01

Detailed source binding

Post by TehBotol »

Seeing as there is now many source of webrip (amazon,netflix,hulu,etc) is it possible for filebot to recognize the filename as the webrip source binding?

so we can use the rename feature to include the source of the webrip?

maybe create new binding like source_full

here is some filename example
1080p.SPIK.WEBRip.AAC2.0.x264-NTb (SPIKE TV)
1080p.AMZN.WEBRip.DD5.1.x264-NTb (Amazon)
720p.HULU.WEBRip.AAC2.0.H264-NTb (Hulu)
1080p.DISC.WEBRip.AAC2.0.x264-NTb (Discovery)
1080p.NF.WEBRip.DD5.1.x264-NTb (Netflix)
1080p.CC.WEBRip.AAC2.0.x264-monkee
1080p.PBS.WEBRip.AAC2.0.H264-monkee
1080p.CRKL.WEBRip.AAC2.0.x264-monkee
1080p.HBO.WEBRip.DD5.1.H264-monkee
720p.EPIX.WEBRip.AAC2.0.H264-monkee
720p.AMBC.WEBRip.AAC2.0.x264-monkee
1080p.VICE.WEBRip.AAC2.0.H264-RTN
1080p.SYFY.WEBRip.AAC2.0.h264-BLUEPLANET
1080p.HN.WEBRip.DD5.1.H264-CasStudio
1080p.TLC.WEBRip.AAC2.0.x264-BTW
1080p.BRAV.WEBRip.AAC2.0.x264-BTW
1080p.NICK.WEBRip.AAC2.0.H264-TVSmash
720p.DSNY.WEBRip.AAC2.0.x264-TVSmash
720p.iP.WEBRip.H264-JiTB
720p.CBC.WEBRip.AAC2.0.H264-RTN

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

Re: Detailed source binding

Post by rednoah »

No, looking at the filenames that doesn't seem feasible.

You can always do it yourself:

Code: Select all

{fn.match(/amazon|netflix|hulu/)}
:idea: Please read the FAQ and How to Request Help.
TehBotol
Supporter
Posts: 34
Joined: 06 Mar 2013, 00:01

Re: Detailed source binding

Post by TehBotol »

thanks didn't know you could do that
also is it possible to rename say like if it found AMZN/NF in filename it will rename it to Amazon or Netflix

thanks again you are awesome
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Detailed source binding

Post by rednoah »

Sure, but if you have many of these mappings I'd define them in an external text file.

Here's a simple condition:

Code: Select all

{fn =~ /AMZN/ ? 'Amazon' : fn =~ /NF/ ? 'Netflix' : null}
@see viewtopic.php?f=5&t=4191
@see viewtopic.php?f=5&t=182
:idea: Please read the FAQ and How to Request Help.
TehBotol
Supporter
Posts: 34
Joined: 06 Mar 2013, 00:01

Re: Detailed source binding

Post by TehBotol »

wow that's awesome rednoah thanks for explaining it,

although it have one small problem as the fn.match is not case sensitive it will detect NF from file name like

tv series s01e01 confession.1080p

is there any way to make fn.match search case sensitive?
thanks again
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Detailed source binding

Post by rednoah »

String.match(regex) is case-insensitive by default. Groovy String =~ regex is not.

You can either use a case-insensitive regex:

Code: Select all

fn =~ /(?i)regex/
Alternatively, you can also use the FileBot built-in String.findMatch(regex) which is case-insensitive by default:

Code: Select all

fn.findMatch(/regex/)
:idea: Please read the FAQ and How to Request Help.
Post Reply