Not matching filename data any longer

Any questions? Need some help?
Post Reply
DevXen
Power User
Posts: 164
Joined: 12 Oct 2014, 21:15

Not matching filename data any longer

Post by DevXen »

I'm not sure if a new update caused this, or if it's something I caused that i hadn't noticed long ago.
I know at one point it did work. now it's not.

it matches the 3D formats just fine. but the extra info. like 'Extended Edition' it's not matching and adding to the name as [Extended Edition] or Widscreen, or Uncut edit, etc, etc, I'll admit i'm not great at regedit and haven't had time to look at it for the past few months, and it kinda looks like there may be some redundant stuff there for the 3D as well. I did notice when i put a '|' before the "(uncensored" it started putting [Extended] but it put it twice (once for the filename, and once for the foldername that it matched i'm sure. also it left out the 'Edition' that it should of put as well.

Code: Select all

{" ["+file.path.lower().replaceAll(/tv/,'TV').replace(/ws/, 'widscreen').replace(/dc/, 'director\'s cut').replaceAll('limited','limited release').replaceAll('directors','director\'s').replaceAll('-','').replaceAll(/director.s|theatrical/,'$0 Cut').replaceAll(/commentary/,'With Commentary').matchAll(/(3d|half|full|h?sbs|f?sbs|(?i)(?<=^|[^a-z])hou(?=$|[^a-z])|(?i)(?<=^|[^a-z])fou(?=$|[^a-z])|f.ou|anaglyth)(?:.sbs|(?i)(?<=^|[^a-z])cat(?=$|[^a-z])) (uncensored|uncut|unrated|remastered|ultimate|extended|director.s|theatrical|ultimate|final|bootleg|special|fan.edit.|with.commentary|limited|rifftrax|monstervision|youtube|hulu|netflix|vimeo|edited|edit|censored|english|fullscreen|widescreen|vhs|tv.movie|criterion.collection|banned|unleashed|renegade|lifetime|hallmark+)(?:.edition|.cut|.version|.edit|.release|.extended|.dub|.rip)?/)*.upperInitial()*.lowerTrail().sort().join('] [').replaceAll('Tv','TV')+']'}{def map=['3d':'3D','hsbs':'Half-SBS','halfsbs':'Half-SBS','fsbs':'Full-SBS','fullsbs':'Full-SBS','sbs':'SBS','halfou':'Half-OU','fullou':'Full-OU','overunder':'OU','anaglyph':'Anaglyph']; " ("+ ((file.path.lower().contains(/3d/)) ? '' : '3D ')+ file.path.lower().replaceAll('half-ou','halfou').replaceAll(/(?i)(?<=^|[^a-z])hou(?=$|[^a-z])/,'halfou').replaceAll(/(?i)(?<=^|[^a-z])fou(?=$|[^a-z])/,'fullou').replaceAll(/(?i)(?<=^|[^a-z])ou(?=$|[^a-z])/,'overunder').replaceAll(/[\W]/, "").replaceAll("3dvd","3.dvd").matchAll(/3d(?!.*?3d)|hsbs(?!.*?hsbs)|halfsbs(?!.*?halfsbs)|fsbs(?!.*?fsbs)|fullsbs(?!.*?fullsbs)|sbs(?!.*?sbs)|halfou(?!.*?halfou)|fullou(?!.*?fullou)|overunder(?!.*?overunder)|anaglyph(?!.*?anaglyph)/).findResults{ map[it]}.sort().join(' ')+')'}

Thanks,
-Dev
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Not matching filename data any longer

Post by rednoah »

1.
You're using matchAll on the full file path, so I'd expect that. Your format is pretty unreadable, so I can't help much here. Maybe using the {tags} and {s3d} bindings might help you clean it up a bit and make things easier to understand and debug.

2.
Why would you use regedit? Windows Registry Editor?

3.
Presumably, you're using file.path instead of fn for a reason. The matchAll method will give you a list for all the matches as the appear. You can use toSorted() and unique() if you want to normalize the result a bit.

e.g.

Code: Select all

[1, 2, 2, 3, 3, 3].unique()
:idea: Please read the FAQ and How to Request Help.
DevXen
Power User
Posts: 164
Joined: 12 Oct 2014, 21:15

Re: Not matching filename data any longer

Post by DevXen »

I meant RegEx.

I didn't know there was a s3D binding, is that new?

And yeah I have it matching from the full path as some have the info in the folder, some in he filename, some in both.
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Not matching filename data any longer

Post by rednoah »

1.
{s3d} has been around for at least a handful of releases. I don't remember when it was added.

2.
Compare & Contrast:

Code: Select all

'Test/Test.avi'.matchAll('Test')

Code: Select all

'Test/Test.avi'.matchAll('Test').unique()
:idea: Please read the FAQ and How to Request Help.
DevXen
Power User
Posts: 164
Joined: 12 Oct 2014, 21:15

Re: Not matching filename data any longer

Post by DevXen »

I was just trying out that {s3d} that's going to become very helpful. but it doesn't support Anaglyth 3D?
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Not matching filename data any longer

Post by rednoah »

You're welcome to suggest improvements. Preferably with example filenames for testing.

The current pattern is:

Code: Select all

((H|HALF|F|FULL)[^\\p{Alnum}]{0,2})?(SBS|TAB|OU)
:idea: Please read the FAQ and How to Request Help.
DevXen
Power User
Posts: 164
Joined: 12 Oct 2014, 21:15

Re: Not matching filename data any longer

Post by DevXen »

Ok, I'll find a few examples. I'm curious does that binding use the filename, meta data, or actually scan the file?
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Not matching filename data any longer

Post by rednoah »

It'll use all known file names (i.e. current filename, original filename and media title).

AFAIK it's not possible to guess 3D tags from the media information, but you're welcome to have a look and see if any properties would allow for that:
viewtopic.php?t=4285
:idea: Please read the FAQ and How to Request Help.
Post Reply