Page 1 of 1

Problem with group detection

Posted: 26 Nov 2016, 00:05
by dauntless101
For some reason my renaming script has had an issue with group detection lately. This is what I am using:

Code: Select all

"seriesFormat=tv/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{norm={it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/\u0022/, '\'').replaceAll(/[:|]/, '.').replaceAll(/\?/, '!').replaceAll(/[*\s\.]+/, '.').replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/[0-9](th|nd|rd)/, { it.lower() })};norm(n) }.{episode.special ? 'S00E'+special.pad(2) : s00e00}.{norm(t)}{'.'+vf}{'.'+source}{'.'+fn.matchAll(/PROPER|REPACK/)*.upper().sort().join('.')}{'.'+vc.replace('Microsoft', 'VC-1').replace('AVC', 'x264')}{'.'+ac.replace('MPEG Audio', 'MP3')}{audio.FormatProfile =~ /MA Core/ ? '-HD.MA' : ''}{audio.FormatProfile =~ /ES/ ? '-ES' : ''}{audio.FormatProfile =~ /Pro/ ? '-Pro' : ''}{'.'+af.replace('8 6ch', '7.1').replace('7 6ch', '6.1').replace('6ch', '5.1').replace('3ch', '2.1').replace('2ch','2.0').replace('1ch','1.0')}{def g = c{group}; def m = c{fn.match(/(?:(?<=[-])[a-z0-9]+$)|(?:^[a-z0-9]+(?=[-]))/)}; if(g!=null) return '-'+g;}{'.'+lang}"
Specificallly the part about the groups here:

Code: Select all

{def g = c{group}; def m = c{fn.match(/(?:(?<=[-])[a-z0-9]+$)|(?:^[a-z0-9]+(?=[-]))/)}; if(g!=null) return '-'+g;}
Even when I tried just a standard {g} in the code it wasn't pulling groups. Not sure what changed because this used to work perfectly.

Thanks!

Re: Problem with group detection

Posted: 26 Nov 2016, 04:37
by rednoah
Please provide a simple reproducible test case (i.e. a filename where {group} doesn't work as expected).

Re: Problem with group detection

Posted: 28 Nov 2016, 00:03
by dauntless101

Code: Select all

[MOVE] Rename [/home/zachary/downloads/complete/movies/Miles.Ahead.2015.1080p.BluRay.DTS-HD.MA.5.1.x264-BluntSlayer-Obfuscated/edefc6a1d4a84fadbe14507b988ea317.mkv] to [/home/zachary/mounts/sorted/media/movies/Miles Ahead (2016)/Miles.Ahead.(2016).1080p.BluRay.x264.DTS.5.1.mkv]

Re: Problem with group detection

Posted: 28 Nov 2016, 08:43
by rednoah
Missing group names can be added upon request.

Please post missing group names here: viewtopic.php?f=5&t=4

Re: Problem with group detection

Posted: 28 Nov 2016, 23:34
by dauntless101
rednoah wrote:Missing group names can be added upon request.

Please post missing group names here: viewtopic.php?f=5&t=4
This is affecting all groups though, not just BluntSlayer. Check these examples:

[MOVE] Rename [/home/zachary/downloads/complete/movies/Star.Trek.3.Beyond.2016.1080p.BluRay.DTS.x264-CyTSuNee/Star.Trek.3.Beyond.2016.1080p.BluRay.DTS.x264-CyTSuNee.mkv] to [/home/zachary/mounts/sorted/media/movies/Star Trek Beyond (2016)/Star.Trek.Beyond.(2016).1080p.BluRay.x264.DTS.5.1.mkv]


[MOVE] Rename [/home/zachary/downloads/complete/movies/Sausage.Party.2016.BluRay.1080p.DTS-HD.MA.5.1.x264.dxva-FraMeSToR/Sausage.Party.2016.BluRay.1080p.DTS-HD.MA.5.1.x264.dxva-FraMeSToR.mkv] to [/home/zachary/mounts/sorted/media/movies/Sausage Party (2016)/Sausage.Party.(2016).1080p.BluRay.x264.DTS.5.1.mkv]

Furthermore, my code originally would parse out the group name from the filename if the AMC group detection did not grab anything. Been using this same script for over a year now, no idea why it stopped working.

Thanks

Re: Problem with group detection

Posted: 29 Nov 2016, 00:49
by rednoah
You'll have to break apart your code and test all bits and pieces individually until you find the single smallest part that doesn't work as expected.

I'd start with {group} and the fn.match pattern.

Re: Problem with group detection

Posted: 29 Nov 2016, 01:44
by dauntless101
rednoah wrote:You'll have to break apart your code and test all bits and pieces individually until you find the single smallest part that doesn't work as expected.

I'd start with {group} and the fn.match pattern.
I understand that and I have been trying for over a week to figure this out. {group} works just fine but this snippet of code completely stopped working during the past month:

Code: Select all

{def g = c{group}; def m = c{fn.match(/(?:(?<=[-])[a-z0-9]+$)|(?:^[a-z0-9]+(?=[-]))/)}; if(g!=null) return '-'+g;}
I found this snippet posted elsewhere on the site so I can't be the only one. It worked for well over a year.

Re: Problem with group detection

Posted: 06 Dec 2016, 17:42
by immenz
Sorry for offtopic, but can anyone explain what c{...} does? I read it elsewhere but without explanation, and searching after a single letter is quite impossible...

Re: Problem with group detection

Posted: 06 Dec 2016, 17:53
by rednoah
This expression is not readable nor well-written. You shouldn't try to learn from it.

PS: the c(Closure) function doesn't exist in newer versions of FileBot

Re: Problem with group detection

Posted: 06 Dec 2016, 18:26
by dauntless101
rednoah wrote: PS: the c(Closure) function doesn't exist in newer versions of FileBot
Ah--that explains it then.