"Original Name" issues & swapping first name last name

All about user-defined episode / movie / file name format expressions
Post Reply
4go3jm92
Posts: 3
Joined: 12 Jun 2015, 14:33

"Original Name" issues & swapping first name last name

Post by 4go3jm92 »

Hello,

Firstly, thanks for such great software!

I have a lot of foreign films and currently I am using this:

Code: Select all

{director} - {y} - {info.OriginalName} ({n})
which gives me this:
Emir Kusturica - 1985 - Otac na sluzbenom putu (When Father Was Away on Business)

However for my english language films it gives me this:
David Lynch - 1990 - Wild at Heart (Wild at Heart)

Is there anyway to get rid of the repeating english title?

Also, I can't seem to find how to swap director's first name & last name to get this:

Kusturica, Emir - 1985 - Otac na sluzbenom putu (When Father Was Away on Business)

Any thoughts!? Thank you
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: "Original Name" issues & swapping first name last name

Post by rednoah »

Easy, just use conditions:

Code: Select all

{n == primaryTitle ? n : "$primaryTitle ($n)"}
:idea: Please read the FAQ and How to Request Help.
4go3jm92
Posts: 3
Joined: 12 Jun 2015, 14:33

Re: "Original Name" issues & swapping first name last name

Post by 4go3jm92 »

rednoah wrote:Easy, just use conditions:

Code: Select all

{n == primaryTitle ? n : "$primaryTitle ($n)"}
thanks rednoah,

The repeating english title is solved. Works great, and is it possible to swap first name, last name of director ie.

Kusturica, Emir - 1985 - Otac na sluzbenom putu (When Father Was Away on Business)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: "Original Name" issues & swapping first name last name

Post by rednoah »

Easy:

Code: Select all

{director.split(/\s/).reverse().join(', ')}
Though, as your personal programmer I do somewhat expect a donation now. ;)
:idea: Please read the FAQ and How to Request Help.
4go3jm92
Posts: 3
Joined: 12 Jun 2015, 14:33

Re: "Original Name" issues & swapping first name last name

Post by 4go3jm92 »

ok i made a donation!

and for future reference here is the code:

Code: Select all

{director.split(/\s/).reverse().join(', ')} - {y} - {n == primaryTitle ? n : "$primaryTitle ($n)"}
that creates:

Kusturica, Emir - 1985 - Otac na sluzbenom putu (When Father Was Away on Business)

thanks again
motorpsycho
Posts: 4
Joined: 23 Nov 2021, 14:38

Re: "Original Name" issues & swapping first name last name

Post by motorpsycho »

Hello, I know this topic it's pretty old now... but I was wondering if it's possible to have the surname in all caps format (eg KUSTURICA, Emir).

With

Code: Select all

{director.upper().split(/\s/).reverse().join(', ')
it would go uppercase both name and surname...
any suggestion?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: "Original Name" issues & swapping first name last name

Post by rednoah »

e.g.

Code: Select all

{ 
	director.split(/\s/).reverse().join(', ').replaceFirst(/\w+/) { it.upper() }
}
:idea: Please read the FAQ and How to Request Help.
motorpsycho
Posts: 4
Joined: 23 Nov 2021, 14:38

Re: "Original Name" issues & swapping first name last name

Post by motorpsycho »

rednoah wrote: 04 Dec 2022, 16:33 e.g.

Code: Select all

{ 
	director.split(/\s/).reverse().join(', ').replaceFirst(/\w+/) { it.upper() }
}
YEEEESSSS!!!!
Thank you!!! :)
Post Reply