Page 1 of 1

A-Z folders using Collection/Movie name

Posted: 13 Jan 2014, 06:47
by Digital God
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] : '#'}

Re: A-Z folders using Collection/Movie name

Posted: 13 Jan 2014, 06:59
by rednoah
This will work in the latest revision, e.g. 4.0_RC1:

Code: Select all

{any{collection}{n} =~ /^(?i)[a-z]/ ? n[0] : '#'}

Re: A-Z folders using Collection/Movie name

Posted: 13 Jan 2014, 07:03
by Digital God
Where can i download 4.0_RC1? On SF i found only 3.8

Re: A-Z folders using Collection/Movie name

Posted: 13 Jan 2014, 07:05
by rednoah
It's where all the other test jars are:
https://sourceforge.net/projects/filebo ... ebot/HEAD/

Re: A-Z folders using Collection/Movie name

Posted: 13 Jan 2014, 07:17
by Digital God
Thanks! Works perfectly

Re: A-Z folders using Collection/Movie name

Posted: 01 Jul 2014, 14:48
by Dasty
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

Re: A-Z folders using Collection/Movie name

Posted: 01 Jul 2014, 15:11
by rednoah
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] : '#'}

Re: A-Z folders using Collection/Movie name

Posted: 01 Jul 2014, 15:21
by Dasty
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.

Re: A-Z folders using Collection/Movie name

Posted: 01 Jul 2014, 15:30
by Dasty
Looks great, thank you very much!