Help collections with year

All about user-defined episode / movie / file name format expressions
Post Reply
gabwzr
Posts: 2
Joined: 27 Aug 2020, 22:43

Help collections with year

Post by gabwzr »

Good Evening,

I am looking to organize some films better and I would like to separate some into collections. in the research done here on the forum, I managed to get close to the result I would like using the following code:

Code: Select all

{vf}/{collection} {cy.join('-')}/{n.colon(' - ')} ({y})/{n.colon(' - ')} ({y}){if (ext == 'srt') '.pt-BR'}{fn.match(/.FORCED/)}
Result:

Code: Select all

1080p/Avatar Collection 2009-2028/Avatar (2009)/Avatar (2009).mkv
but only the year of the collection between brackets is missing. I would like a result close to:

Code: Select all

1080p/Avatar Collection (2009-2028)/Avatar (2009)/Avatar (2009).mkv
1080p/James Bond Collection 1962-2020/Quantum of Solace (2008)/Quantum of Solace (2008).mkv
1080p/3 Things (2017)/3 Things (2017).mkv
I tried to put the parentheses manually between the {cy} function, but when there is no collection a folder "()" is created.
I also tried to use the {any {collection} ...} function but I was unable to make the years appear. I didn't quite understand this function.

I would like to know if anyone could help me with these questions.
Thank you very much.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Help collections with year

Post by kim »

Code: Select all

{vf}{ any{'/' + collection + ' (' + cy.join('-') + ')'} {''} }{'/' + ny}{'/' + ny}
or

Code: Select all

{vf}{ allOf{'/' + collection + ' (' + cy.join('-') + ')'} {''}.join() }{'/' + ny}{'/' + ny}
or

Code: Select all

{vf}{ allOf{'/' + collection}{' (' + cy.join('-') + ')'}.join() }{'/' + ny}{'/' + ny}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help collections with year

Post by rednoah »

I'd write it like this:

Code: Select all

{vf}{"/${collection} (${cy.join('-')})"}/{plex.tail}
If collection fails, or if cy fails, then {expression} yields no result:
viewtopic.php?t=1895
:idea: Please read the FAQ and How to Request Help.
gabwzr
Posts: 2
Joined: 27 Aug 2020, 22:43

Re: Help collections with year

Post by gabwzr »

kim wrote: 28 Aug 2020, 00:26

Code: Select all

{vf}{ any{'/' + collection + ' (' + cy.join('-') + ')'} {''} }{'/' + ny}{'/' + ny}
or

Code: Select all

{vf}{ allOf{'/' + collection + ' (' + cy.join('-') + ')'} {''}.join() }{'/' + ny}{'/' + ny}
or

Code: Select all

{vf}{ allOf{'/' + collection}{' (' + cy.join('-') + ')'}.join() }{'/' + ny}{'/' + ny}
rednoah wrote: 28 Aug 2020, 01:56 I'd write it like this:

Code: Select all

{vf}{"/${collection} (${cy.join('-')})"}/{plex.tail}
If collection fails, or if cy fails, then {expression} yields no result:
viewtopic.php?t=1895
@kim and @rednoah
thank you very much!! that was exactly what I was looking for. congratulations.
thanks again!
dirkie1980
Posts: 1
Joined: 05 Nov 2020, 16:48

Re: Help collections with year

Post by dirkie1980 »

Filebot syntax of Collections with the year is cy. I need reverse order how should I do or is it possible? I want to start greater values of the year then descent order to lower values of the year.

{cy} default is [2004, 2020] which lower year is first, then next. But I want rather do it reverse order [2020, 2004]

Any help would be glad. Thanks.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help collections with year

Post by rednoah »

e.g.

Code: Select all

{cy.reverse()}
:idea: Please read the FAQ and How to Request Help.
Post Reply