Struggling to achieve desired format for 3D movies

Any questions? Need some help?
Post Reply
Alterius
Posts: 2
Joined: 08 Apr 2018, 12:02

Struggling to achieve desired format for 3D movies

Post by Alterius »

Hello.

My current movie script is so far very simple:

Code: Select all

Movies/{n} ({y})/{n} {[allOf{source}{vf}{vc}{af}{ac}.join('.')]}
I am currently looking for a versatile solution for 3D movies, ideally, based off of the s3d tag as that supposedly captures pretty much every combination of 3D types ever written into a filename.

Ideally, upon detecting the file is 3D, I would like the script to fill out the filename as follows:

Code: Select all

{n} [3D] [3D format] {[allOf{source}{vf}{vc}{af}{ac}.join('.')]}
For example: Movies/The Lego Movie (2014)/The Lego Movie [3D] [H-SBS] [BluRay.1080p.x265.6ch.AAC]

However with the 3D format accounting for all possible varieties, and unifying to a X-XXX format (HSBS -> H-SBS, HOU -> H-OU e.t.c.) where applicable.

This level of regex is beyond me however :(
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Struggling to achieve desired format for 3D movies

Post by rednoah »

This should do it:

Code: Select all

{"[3D] [$s3d]"}
Since s3d fails for non-3D movies, the expression simply won't yield any value (also not the [3D] part) for non-3D movies:
viewtopic.php?f=5&t=1895

s3d should do some normalization as well. Just give it a spin on a few files and see what happens and report back on your findings. ;)
:idea: Please read the FAQ and How to Request Help.
Alterius
Posts: 2
Joined: 08 Apr 2018, 12:02

Re: Struggling to achieve desired format for 3D movies

Post by Alterius »

That's worked perfectly, thanks! It must be down to that $ sign, I hadn't yet come across that or what it does.

My test case was 1 HSBS label and 1 H-SBS label, which {s3d} doesn't currently format into one or the other- it sticks to the original. regrettably I don't have any other style of movie to test! But to be honest that's a really minor niggle I'm not too bothered about- and I'd way rather have {s3d} doing the heavy lifting ;)

Thanks again Noah!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Struggling to achieve desired format for 3D movies

Post by rednoah »

You can just strop non-word characters from the s3d value like this:

Code: Select all

s3d.removeAll(/\W/)

Code: Select all

{"[3D] [${s3d.removeAll(/\W/)}]"}
@see http://groovy-lang.org/syntax.html#_str ... erpolation
:idea: Please read the FAQ and How to Request Help.
Post Reply