Broken "group" script

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Broken "group" script

Post by kim »

this works in FileBot 4.6.2 (r3725) / Java(TM) SE Runtime Environment 1.8.0_73
but i tried FileBot 4.6.2 (r3813) and now its broken/not working...
it looks like "c{" is now "collect{" ?
and there MOST be a match or it fails, so "any{collect}{}" ?

Code: Select all

{def dn = c{(file.parentFile.name).match(/(?:\\-\\w+(?=\\[\\w+\\])|\\-\\w+$)/)}; def nn = c{fn.match(/(?:(?=(?:19|20)+[0-9]+)\\w.+$)/)}; def g = c{(file.parentFile.name+'.'+fn).find(/\\-/) ? c{group.replaceAll(/\\bDK\\b|\\bFS\\b/,'')} : null}; def nog = c{(file.parentFile.name+'.'+fn).find(/\\-/)} ? c{group} : null; def gg = '-'+g; def gb = c{n.match(/(?:^\\w{3,}(?=[-]))/)}; def fm = c{fn.match(/(?:(?:\\-(?!\\bDL\\b|\\bRip\\b|\\bES\\b|\\bHD\\b)\\w+$)|(?:\\-(?!\\bDL\\b|\\bRip\\b|\\bES\\b|\\bHD\\b)\\w+[\\.\\_]\\w+[\\-]\\w+$)|(?:\\-\\w+(?=\\.cd[0-9]|\\-trailer|\\.part[0-9]|\\.dan|\\.eng))|(?:\\-(?!\\bDL\\b|\\bRip\\b|\\bES\\b|\\bHD\\b)\\w+[\\-\\.\\_](?!\\b720p\\b|\\b1080p\\b)\\w+$)|(?:\\-\\w+[\\.]+\\w+(?=\\.cd[0-9]))|(?:\\-(?!\\bDL\\b|\\bRip\\b|\\bES\\b|\\bHD\\b)\\w+(?=\\[\\w+\\]$)))/)}; if(g!=null && dn!=null && gg.equalsIgnoreCase(dn)) return '-'+g; if(g!=null && dn!=null) return dn; if(g!=null && fm!=null && (gg.equalsIgnoreCase(fm))) return '-'+g; if(g!=null && nog==null && (fm!=null||gb!=null)) return '-'+g; if(g!=null && fm==null && gb==null && g!='') return '-'+g; if(g==null && nog!=null) return '-'+nog; if(g==null && fm!=null && nn!=null) return ''+fm; if(gb!=null && fm!=null && nn!=null) return '-'+gb; if(gb!=null && g==null && fm==null && g==null && dn==null) return '-'+gb; if(g!=null && fm!=null && g!=fm) return fm; if(nn==null && dn!=null) return dn}
User avatar
rednoah
The Source
Posts: 22987
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Broken "group" script

Post by rednoah »

I think c(Closure) was changed to call(Closure) but otherwise there shouldn't be any differences.
:idea: Please read the FAQ and How to Request Help.
Post Reply