A-Z folders using Collection/Movie name

All about user-defined episode / movie format expressions
Post Reply
Digital God
Posts: 7
Joined: 13 Jan 2014, 06:41

A-Z folders using Collection/Movie name

Post by Digital God » 13 Jan 2014, 06:47

Greetings to all.
Need help with "[SNIPPET] Sort into A-Z folders". How can i check that movie has collection?
I want to use first letter of movie name, if there is no collection. And first letter of collection, if it exists.

Something like this
{def ln;}{ln = n}{ln = collection}{ln =~ /^(?i)[a-z]/ ? ln[0] : '#'}

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: A-Z folders using Collection/Movie name

Post by rednoah » 13 Jan 2014, 06:59

This will work in the latest revision, e.g. 4.0_RC1:

Code: Select all

{any{collection}{n} =~ /^(?i)[a-z]/ ? n[0] : '#'}
:idea: Please read the FAQ and How to Request Help.

Digital God
Posts: 7
Joined: 13 Jan 2014, 06:41

Re: A-Z folders using Collection/Movie name

Post by Digital God » 13 Jan 2014, 07:03

Where can i download 4.0_RC1? On SF i found only 3.8

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: A-Z folders using Collection/Movie name

Post by rednoah » 13 Jan 2014, 07:05

It's where all the other test jars are:
https://sourceforge.net/projects/filebo ... ebot/HEAD/
:idea: Please read the FAQ and How to Request Help.

Digital God
Posts: 7
Joined: 13 Jan 2014, 06:41

Re: A-Z folders using Collection/Movie name

Post by Digital God » 13 Jan 2014, 07:17

Thanks! Works perfectly

Dasty
Posts: 3
Joined: 01 Jul 2014, 13:38

Re: A-Z folders using Collection/Movie name

Post by Dasty » 01 Jul 2014, 14:48

Hi all,

hope you can help me.

Thats my Code

Code: Select all

{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]"}
What i try:
If Collection is availabe:
D/Dark Knight Collection, The/Dark Knight Rises, The (2012)/Dark Knight Rises, The (2012)

If not:
A/Assassin next Door, The (2009)/Assassin next Door, The (2009)

but the Snippet use the first letter of the name everytime

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: A-Z folders using Collection/Movie name

Post by rednoah » 01 Jul 2014, 15:11

Yes, that's how you've defined it in your format:

Code: Select all

n[0]
You might want this:

Code: Select all

{def cn = any{collection}{n}; cn =~ /^(?i)[a-z]/ ? cn[0] : '#'}
:idea: Please read the FAQ and How to Request Help.

Dasty
Posts: 3
Joined: 01 Jul 2014, 13:38

Re: A-Z folders using Collection/Movie name

Post by Dasty » 01 Jul 2014, 15:21

I know, but that's how you've defined it at the top of the Topic. If i use collection instead of n, they can't handle movies without a collection. Tryed something but nothing really works. Need help.

Dasty
Posts: 3
Joined: 01 Jul 2014, 13:38

Re: A-Z folders using Collection/Movie name

Post by Dasty » 01 Jul 2014, 15:30

Looks great, thank you very much!

Post Reply