Movie collection prefix by date and suffix title

All about user-defined episode / movie / file name format expressions
Post Reply
TurkeyGravy
Posts: 2
Joined: 19 Sep 2017, 19:49

Movie collection prefix by date and suffix title

Post by TurkeyGravy »

Hello, after trying a few different things and getting stressed out over it I decided to ask for some help. I'm trying to make the following with my movies:
  • Pain & Gain (2013)
  • User/Movies/Pirates of the Caribbean (2003), Curse of the Black Pearl
  • User/Movies/Pirates of the Caribbean (2017), Dead Men Tell No Tales
I'm having no luck with the second two, to get the collection prefix and date followed by movie title. I like this as it groups the movies of a trilogy together, ordered by date, and still gives the movie installment title. Has anyone got something similar? I would like it to be able to run through ones in collections and ones not, and output accordingly.

I have tried things along the lines of:
  • {$Collection = "" ? '' : ({collection.replaceAll("Collection", replacement = "")}+"("+{y}+"),")}
This still outputted a date on a single movie, meaning it would come before the movie installment name.

Then there is removing the collection name from the installment name:
  • {n.replaceAll($Collection, replacement ="").replaceAll("Collection", replacement ="")}
Again no luck with this part, as I don't fully understand the stacking of elements and breakout.

Any help is greatly apprechiated.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Movie collection prefix by date and suffix title

Post by kim »

something like this ?

Code: Select all

{any{if (collection != null) {def ntmp = n.split(':');(allOf{collection.replaceAll(/Collection/)+'('+y+')'}{''+ntmp[ntmp.size()-1]}).join(', ')}}{ny}
}
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Movie collection prefix by date and suffix title

Post by kim »

or to deal with e.g. "Mission: Impossible Collection" and don't F up e.g. "Kick-Ass Collection"

Code: Select all

{any{if (collection != null) {def ntmp = n.split(': | - ');(allOf{collection.replaceAll(/Collection/)+'('+y+')'}{''+ntmp[ntmp.size()-1]}).join(', ')}}{ny}
}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Movie collection prefix by date and suffix title

Post by rednoah »

This example might give you some idea:

Code: Select all

{collection.before('Collection')} {y} - {n.after(':')}
:!: Only tested with Pirates of the Caribbean so it probably won't just work for everything :!:
:idea: Please read the FAQ and How to Request Help.
TurkeyGravy
Posts: 2
Joined: 19 Sep 2017, 19:49

Re: Movie collection prefix by date and suffix title

Post by TurkeyGravy »

kim wrote: 19 Sep 2017, 23:57 or to deal with e.g. "Mission: Impossible Collection" and don't F up e.g. "Kick-Ass Collection"

Code: Select all

{any{if (collection != null) {def ntmp = n.split(': | - ');(allOf{collection.replaceAll(/Collection/)+'('+y+')'}{''+ntmp[ntmp.size()-1]}).join(', ')}}{ny}
}
Thank you very much for this, it works a dream. There are some that don't come out as intended (Monsters 2010), but I believe it may be a metadata issue as others are working.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Movie collection prefix by date and suffix title

Post by kim »

this ?
https://www.themoviedb.org/collection/3 ... uage=en-US

works fine here:
Monsters (2010), Monsters
Monsters (2014), Dark Continent
Post Reply