File Renaming including English and Foreign Titles

Any questions? Need some help?
Post Reply
jerome
Posts: 31
Joined: 25 Feb 2019, 02:21

File Renaming including English and Foreign Titles

Post by jerome »

I've only been testing this program for about a week on Windows 10. I have managed to find the answers to most of my questions on this great forum for my GUI coding (not yet prepared to try AMC script). Except I am stumped with one specific movie that is not yielding the expected result

Here is the movie link
https://www.themoviedb.org/movie/401545 ... uage=en-US

Here is the code:

Code: Select all

{n.colon("-").replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)} ({y}) {info.OriginalLanguage =~ /^(?i)['en']/ ? '' : primaryTitle.transliterate("latin")}
Similar to my other foreign movies I was expecting the output to be:
Everybody Knows (2018) Todos lo saben

Instead it's just
Everybody Knows (2018)

These are the results of some of the partial coding:
{primaryTitle.transliterate("latin")} yields Todos lo saben
{info.OriginalLanguage} yields es
{info.SpokenLanguages} yields en,de,es,it,ca

I thought maybe it was because this movie has two languages listed as Original Languages but not sure how to correct for that. Any help or direction would be appreciated.

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

Re: File Renaming including English and Foreign Titles

Post by rednoah »

1.
This works for me:

Code: Select all

{n.colon('-').sortName('$2, $1')} ({y}) {info.OriginalLanguage =~ /en/ ? null : primaryTitle.ascii()}


2.
This regular expression doesn't do what you think it does:

Code: Select all

/^(?i)['en']/
https://regexr.com/

You probably mean this:

Code: Select all

/^(?i)en/
:idea: Please read the FAQ and How to Request Help.
jerome
Posts: 31
Joined: 25 Feb 2019, 02:21

Re: File Renaming including English and Foreign Titles

Post by jerome »

Thanks rednoah for those pointers and the direction to some further reading. Those snippets helped fix the script. I was aware of the sortName('$2, $1') binding and the ascii but I prefer only to move the word "The" in movies and leave "A" and "And" as is, as well as have the accents on my foreign titles.

I have a lot to learn here and I really appreciate your guidance. I wish I had found this program sooner.

J
Post Reply