Movie Renaming Expression for "Studio" ?

All about user-defined episode / movie format expressions
Post Reply
flecki
Posts: 4
Joined: 18 Jun 2020, 05:35

Movie Renaming Expression for "Studio" ?

Post by flecki »

BEGINNER Question!

Hello! I use MetaMovie by appfacture to tag my movies. Then I like to add the "studio" to my renaming, but I stuck with the expression for "studio".

MediaInfo shows as "ProductionStudio" but how can I put it into the right syntax?

It should look like this:

Warner Bros. Pictures - The Green Mile - 2000-02-10 - etc ...

I figured out everything so for, learning how to use filbot. But I stuck with that studio tag...

Can anyone help me out?
kim
Power User
Posts: 1050
Joined: 15 May 2014, 16:17

Re: Movie Renaming Expression for "Studio" ?

Post by kim »

Code: Select all

{info.productionCompanies}
AbedlaPaille
Posts: 99
Joined: 12 Apr 2020, 04:02

Re: Movie Renaming Expression for "Studio" ?

Post by AbedlaPaille »

Check out my Studios collections hardlinks, might help you understanding how it works.

Code: Select all

F:/Studios/

{info.productionCompanies =~ /Studio Ghibli/ ? 'Ghibli Collection' : info.productionCompanies =~ /Pixar/ ? 'Pixar Collection' : info.productionCompanies =~ /Marvel Studios/ ? 'MCU Collection' : ''}
	 
/

{y+'. '}

{norm = {it.slash('-').replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ").replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower() })}; 
	{info.OriginalLanguage =~ /fr/ ? norm(localize.French.n) : norm(localize.English.n)}}

/

{info.OriginalLanguage =~ /fr/ ? norm(localize.French.ny) : norm(localize.English.ny)}

{! (info.OriginalLanguage ==~ /(en|fr)/) ? ' ('+norm(primaryTitle.ascii().upperInitial())+')' :''}

{tags ? ' '+tags : ' ['+fn.matchAll(/UNCENSORED|UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTOR\'?S[ ._-]CUT|THEATRICAL[ ._-]CUT|ULTIMATE[ ._-]CUT|FINAL[ ._-]CUT|SPECIAL[ ._-]EDITION/)*.upperInitial()*.sort().join(' ').replaceAll(/[.]/, " ") + ']'}

{any{' '+fn.match(/CD\d+/).upper()}
    {" CD$pi"}}

{allOf{vs}
      {vf}
      {channels.match(/5.1|7.1/)}
      {any{video.CodecID =~ /hev1|hevc|HEVC/ ? 'HEVC' : ''}
          {video.CodecID =~ /AVC|avc|avc1/ ? 'AVC' : ''}
          {vc}}
      {if (bitdepth == 10) '10bit'}
      {any{audio.size() > 2 ? 'MULTI' : audio.size() > 1 ? 'DUAL '+audioLanguages.join('-').upper() : ''}
          {audio[0].language != /en/ ? audioLanguages[0].name.upper() : ''}}
      {any{textLanguages =~ /fra/ ? 'VOSTFR' : textLanguages =~ /eng/ ? 'VOSTEN' : ''}
          {fn.match(/VOSTFR|Vostfr|vostFR|VostFR|vostfr/).upper()}}
      {mbps}.joining(' ', ' [', ']')}

{'.'+lang.ISO2}{if (ext == 'srt' && dc > 2) " ($di)"}
Keep in mind there's often a lot of production companies on a single movie.
kim
Power User
Posts: 1050
Joined: 15 May 2014, 16:17

Re: Movie Renaming Expression for "Studio" ?

Post by kim »

doing same thing different

Code: Select all

{ info.productionCompanies =~ /Studio Ghibli/ ? 'Ghibli Collection' : info.productionCompanies =~ /Pixar/ ? 'Pixar Collection' : info.productionCompanies =~ /Marvel Studios/ ? 'MCU Collection' : '' } 

{ any{ def pc = info.productionCompanies; (pc =~ /Studio Ghibli/ ? 'Ghibli' : pc =~ /Pixar/ ? 'Pixar' : pc =~ /Marvel Studios/ ? 'MCU' : '') + ' Collection' }{''} } 

{ any{info.productionCompanies.join('*').match(/Ghibli|Pixar|Marvel Studios/).replace('Marvel Studios','MCU') + ' Collection'}{''} } 
Deadpool 2 ? ... maybe use keywords

Code: Select all

{ any{(info.productionCompanies.join('*').find(/Ghibli|Pixar/) || info.keywords.contains(/marvel cinematic universe/) ? 'MCU' : '') + ' Collection'}{''} }
flecki
Posts: 4
Joined: 18 Jun 2020, 05:35

Re: Movie Renaming Expression for "Studio" ?

Post by flecki »

Hello everybody!

I'm still a complete beginner with FileBot and I'm learning slowly.

My video files are all tagged with metadata and I want to generate movie names from this metadata. This works quite well so far.

Here is my expression:

Code: Select all

{media.ProductionStudio} - ({media.RecordedDate}) - {media.Title} - ({vf}) - ({media.OverallBitRateString.replace('/','p')}) - ({media.Framerate} fps) 
But there is one exception that drives me crazy:

"media.RecordedDate" is read out in a very unsightly format, either

"UTC 2016-11-10 12:00:00"
or
"2015-4-20T11:00:00Z"

and I still haven't found a way to make it look that way without the time and other stuff:

"2015-04-20"

No matter what I try, either there is nothing there anymore, or (with .format) yyyy-MM-dd is there instead of the date numbers. What can I do? I looked around in the forum and have tried ".parse" and ".format." so far.

Can anyone help me out?
User avatar
rednoah
The Source
Posts: 19164
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Movie Renaming Expression for "Studio" ?

Post by rednoah »

You could use regular expressions to select the text you want:

Code: Select all

media.RecordedDate.match(/\d+-\d+-\d+/)
:idea: Please read the FAQ and How to Request Help.
flecki
Posts: 4
Joined: 18 Jun 2020, 05:35

Re: Movie Renaming Expression for "Studio" ?

Post by flecki »

Thats it!!! Woohoo! Thanks, rednoah! I am very apreciated!
flecki
Posts: 4
Joined: 18 Jun 2020, 05:35

Re: Movie Renaming Expression for "Studio" ?

Post by flecki »

rednoah wrote: 28 Jun 2020, 15:14 You could use regular expressions to select the text you want:

Code: Select all

media.RecordedDate.match(/\d+-\d+-\d+/)
may i ask an additional question? While doing it so works like a charm for my needs, i found that the date is this way: 2020-1-4 and i tried for days, figuring out how to add a 0 to 1-digit days and months, looking like this: 2020-01-04.

Is there a way to make it this way?
User avatar
rednoah
The Source
Posts: 19164
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Movie Renaming Expression for "Studio" ?

Post by rednoah »

You'd have to split by - and then 0-pad each value and then join by - again.

A bit of basic Groovy programming will be helpful for writing that as Groovy code.


e.g.

Code: Select all

'2020-1-4'.split(/\D/)*.pad(2).join('-')
// Result: 2020-01-04
:idea: Please read the FAQ and How to Request Help.
Post Reply