conditional collection & genre scheme

All about user-defined episode / movie / file name format expressions
Post Reply
fireheart2008
Posts: 37
Joined: 29 Jul 2014, 05:39

conditional collection & genre scheme

Post by fireheart2008 »

before anybody tells me to check other posts
i have already done that and did not get what i want
http://www.filebot.net/forums/search.ph ... onditional


The conditional naming scheme is
if the movie is a part of collection:
Collections\Dark Knight Collection, The \Batman Begins [2005, PG-13, 8.3]

if the movie is not a part of collection:
[Drama]\Perks of Being a Wallflower, The [2012, PG-13, 8.1]

i use this
{collection.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)}[{genres.contains('Animation') ? 'Animation' : genres[0]}]\{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} {[y, imdb.certification, imdb.rating]}\

but i can't figure how to create the Collections folder

so basically i want to sort movies into collections and non-collections, and sort non-collections into genres with forcing animation genre if present

and i don't care if the collections has [{genres.contains('Animation') ? 'Animation' : genres[0]}] or not

i hope i made it clear
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: conditional collection & genre scheme

Post by rednoah »

This is a good example for my extension method any(Closure...)

Code: Select all

{ any{ collection.sortName() }{ genres.find{ it == 'Animation' } }{ genres[0] } }
:idea: Please read the FAQ and How to Request Help.
fireheart2008
Posts: 37
Joined: 29 Jul 2014, 05:39

Re: conditional collection & genre scheme

Post by fireheart2008 »

that code is really neat :)

but does not solve the problem

i have some ideas that could not figure out how to do

1- using sth like this
http://www.filebot.net/forums/viewtopic ... 257#p10445
{any{collection}{n} =~ /^(?i)[a-z]/ ? n[0] : '#'}/{"$collection".replaceFirst(/^(?i)(The|A|An|Der|Die|Das)\s(.+)/, /$2, $1/)+"/"}{n.replaceFirst(/^(?i)(The|A|An|Der|Die|Das)\s(.+)/, /$2, $1/)} ({y})/{n.replaceFirst(/^(?i)(The|A|An|Der|Die|Das)\s(.+)/, /$2, $1/)} ({y}){" [Part$pi]"}

but modify the colored part so that If Collection is availabe it will go to collections folder and If not avaiable, it goes to {genres.contains('Animation') ? 'Animation' : genres[0]}


2- if Collection is availabe it will use the naming scheme: collections\{collection}\{n}
if Collection is not availabe it will use the naming scheme : {genres.contains('Animation') ? 'Animation' : genres[0]}\{n}
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: conditional collection & genre scheme

Post by rednoah »

How does that not solve the problem?

Try A, if A not available try B, if B not available try C. That's exactly what you want / need.

1.
Your format. You go modify it... I already showed you how.

2.
It's not that much of a leap is it?

Code: Select all

{ any{ 'Collections/' + collection.sortName() }{ genres.find{ it == 'Animation' } }{ genres[0] } }/...
:idea: Please read the FAQ and How to Request Help.
fireheart2008
Posts: 37
Joined: 29 Jul 2014, 05:39

Re: conditional collection & genre scheme

Post by fireheart2008 »

Thank you so much!

{ any{ 'Collections/' + collection.sortName() }{ genres.find{ it == 'Animation' } }{ genres[0] } } is exactly what i want

'Collections/' + was the issue. was not written in the 1st reply & did not know how to do it
----------------




Topic : Closed
Post Reply