Way to add LANGUAGE only when it isn't English?
Way to add LANGUAGE only when it isn't English?
Hello,
Is there a way to add a LANGUAGE part in my renaming scheme but only when the language of the movie isn't English? Thx in advance!
Is there a way to add a LANGUAGE part in my renaming scheme but only when the language of the movie isn't English? Thx in advance!
Re: Way to add LANGUAGE only when it isn't English?

e.g. yield nothing for files that have one or more English audio streams, among possibly others audio streams for other languages:
Code: Select all
{ audioLanguages =~ /eng/ ? null : audioLanguages }
Code: Select all
{ audioLanguages.size() == 1 && audioLanguages =~ /eng/ ? null : audioLanguages }
Re: Way to add LANGUAGE only when it isn't English?
Thank u kindly! Will check this out!
I'm trying to add information to movies that are spoken in a different language (Japanese, French, etc. ) because they are automatically renamed to their English name by Filebot.
e.g.
Movie called 'L'adversaire' is now renamed 'The Adversary (2002) [Mystery, Nicole Garcia, 1080p]' in my current Filebot setup. I would like the program to rename it to 'The Adversary (2002) [FRENCH, Mystery, Nicole Garcia, 1080p]' for example but only when the movie isn't English.
I'm trying to add information to movies that are spoken in a different language (Japanese, French, etc. ) because they are automatically renamed to their English name by Filebot.
e.g.
Movie called 'L'adversaire' is now renamed 'The Adversary (2002) [Mystery, Nicole Garcia, 1080p]' in my current Filebot setup. I would like the program to rename it to 'The Adversary (2002) [FRENCH, Mystery, Nicole Garcia, 1080p]' for example but only when the movie isn't English.
Re: Way to add LANGUAGE only when it isn't English?
Code: Select all
{plex.name} {allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}
The Adversary (2002) [FRENCH, Mystery, Nicole Garcia, 1080p]
Re: Way to add LANGUAGE only when it isn't English?
Thx for the effort! I'm using this one atm:kim wrote: ↑31 Jan 2022, 16:34sample:Code: Select all
{plex.name} {allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}
The Adversary (2002) [FRENCH, Mystery, Nicole Garcia, 1080p]
Code: Select all
{ny.colon(/ - /)} [{genre}, {director}, {vf}]/{plex.name} [{genre}, {director}, {vf}]{subt}
Is there a way to combine my code with yours?
Re: Way to add LANGUAGE only when it isn't English?
This one seems to do the trick although it gives some strange results!
Thx for the brilliant code BTW!
Where does it get its information from concerning the language?{ny.colon(/ - /)} {allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}{subt}
Thx for the brilliant code BTW!
Re: Way to add LANGUAGE only when it isn't English?
what strange results! ?
https://www.themoviedb.org/movie/52999- ... uage=en-US
Plex Naming Schemes
viewtopic.php?p=23141#p23141
https://www.themoviedb.org/movie/52999- ... uage=en-US
Code: Select all
{ plex.derive{allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}.name }
Code: Select all
{(plex^ null).name } {allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}{subt}
viewtopic.php?p=23141#p23141
Re: Way to add LANGUAGE only when it isn't English?
For example, 'Black' (https://www.imdb.com/title/tt4008758/), a movie that's mostly french/dutch spoken is considered 'ARABIC' by the renaming scheme! 

Re: Way to add LANGUAGE only when it isn't English?
What's the difference between these 2 codes? Should I use one for the main movie and the rest for the subs? I also noticed that your formula does not alter the FOLDER-name, which should also mention the movie's language. Is there a possiblity to achieve this? Do I just use the code 2 times?kim wrote: ↑31 Jan 2022, 22:33 what strange results! ?
https://www.themoviedb.org/movie/52999- ... uage=en-US
Code: Select all
{ plex.derive{allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}.name }
Plex Naming SchemesCode: Select all
{(plex^ null).name } {allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}{subt}
viewtopic.php?p=23141#p23141
Re: Way to add LANGUAGE only when it isn't English?
Mmm, naming is completely screwed now. My former formula took both movie and subs (with specific language indicator such as '.eng') and put them in one folder, ignoring all the filler. With the formulas u suggested I'm getting 2 seperate folders atm.kim wrote: ↑31 Jan 2022, 22:33 what strange results! ?
https://www.themoviedb.org/movie/52999- ... uage=en-US
Code: Select all
{ plex.derive{allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}.name }
Plex Naming SchemesCode: Select all
{(plex^ null).name } {allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}{subt}
viewtopic.php?p=23141#p23141
e.g.
Hellboy (2004) [Fantasy, Guillermo del Toro, 1080p] & Hellboy (2004) [Fantasy, Guillermo del Toro, 1080p].eng
The latter containing the subtitles.
I think my definitive naming scheme would be something like this:
Hellboy (2004) [Fantasy, Guillermo del Toro, 1080p]\Hellboy (2004)
with subtitles in the same folder named Hellboy (2004).eng.srt
Is that a plausible route?
Thx in advance!
Re: Way to add LANGUAGE only when it isn't English?
Code: Select all
{ plex[1] }/{ plex.derive{allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}.name }
Hellboy (2004)/Hellboy (2004) [Fantasy, Guillermo del Toro, 1080p]
Re: Way to add LANGUAGE only when it isn't English?
Thx for the code but now it still puts the subs in a seperate folder.kim wrote: ↑01 Feb 2022, 22:11Code: Select all
{ plex[1] }/{ plex.derive{allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}.name }
Hellboy (2004)/Hellboy (2004) [Fantasy, Guillermo del Toro, 1080p]
When I use this:
I get this for the sub folder:E:\[Video]\{ plex.derive{allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}.name }\{ plex[1] }
E:/[Video]/Hellboy (2004) [Fantasy, Guillermo del Toro, 1080p].eng/Hellboy (2004)
Re: Way to add LANGUAGE only when it isn't English?
Any suggestions? I'm kinda stuck here.kim wrote: ↑01 Feb 2022, 22:11Code: Select all
{ plex[1] }/{ plex.derive{allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']')}.name }
Hellboy (2004)/Hellboy (2004) [Fantasy, Guillermo del Toro, 1080p]

Re: Way to add LANGUAGE only when it isn't English?
{plex.name} includes the subtitle suffix for subtitle files. So you can't use that component for a folder level in your format.
e.g. generate file names and rename files in place:
e.g. generate absolute file paths to move files into a new file and folder structure:
One of the suggestions above; use second folder and final file name component from the {plex} path; can work:
but then you turned it around for some reason, but that won't make sense, because you're using the file name component which includes .eng bit as folder level, so you get folders for each subtitle language, and more folders for non-subtitle files:
Can you provide a few sample file path for what you want? I'm not actually sure what kinda file paths you want FileBot to generate at this point, since we're already pretty off-topic from the original question.
EDIT:
If you want to use the {plex} format but append to values to the movie / series folder name, then that would work like this:
e.g. generate file names and rename files in place:
Code: Select all
{plex.name}
Code: Select all
X:/Plex/{plex}
One of the suggestions above; use second folder and final file name component from the {plex} path; can work:
Code: Select all
{ plex[1] }/{ plex.name }
Code: Select all
{ plex.name }/{ plex[1] }

EDIT:

Code: Select all
X:/Plex/{ plex * { allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']') } }
rednoah wrote: ↑12 Sep 2016, 10:03 e.g. Avatar (2009) [M19995]/Avatar (2009)Code: Select all
{ ~plex * " [M$id]" }
Re: Way to add LANGUAGE only when it isn't English?
I turned it around because the turned around version is what I initially asked for.rednoah wrote: ↑03 Feb 2022, 00:33 [
One of the suggestions above; use second folder and final file name component from the {plex} path; can work:but then you turned it around for some reason, but that won't make sense, because you're using the file name component which includes .eng bit as folder level, so you get folders for each subtitle language, and more folders for non-subtitle files:Code: Select all
{ plex[1] }/{ plex.name }
Code: Select all
{ plex.name }/{ plex[1] }
I would like to be my organisation like this:
e.g.
Code: Select all
X:/Dark Habits (1983) [SPANISH, Comedy, Pedro Almodóvar, 1080p]/Dark Habits (1983)
Code: Select all
X:/Dark Habits (1983) [SPANISH, Comedy, Pedro Almodóvar, 1080p]/Dark Habits (1983).eng.srt
Important features are:
- Language indicator other than English first in the specification list
- Sub with language indicator (.eng or others) in subtitles
I initially used this:
to rename my movies and that worked perfectly but most importantly I need the language indicator in the folder's name.{ny.colon(/ - /)} [{genre}, {director}, {vf}]/{plex.name} [{genre}, {director}, {vf}]{subt}
Re: Way to add LANGUAGE only when it isn't English?
I see. I'd start with this example from the {plex} format manual:
Alternatively, you can just add the { languages =~ /eng/ ? null : languages.name[0].upper() } bit into the format that you were previously happy with. I shall note though that your format uses {plex.name} incorrectly and so it will inject a ".eng" bit in the middle of the filename when processing subtitle files. It also doesn't account for undefined bindings, and so you might end up with [, , , 720p] in the specification bit for one file or another.
and then copy & paste your specification list code:rednoah wrote: ↑12 Sep 2016, 10:03 e.g. Avatar (2009) [M19995]/Avatar (2009)Code: Select all
{ ~plex * " [M$id]" }
Code: Select all
X:/{ ~plex * { allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']') } }
Alternatively, you can just add the { languages =~ /eng/ ? null : languages.name[0].upper() } bit into the format that you were previously happy with. I shall note though that your format uses {plex.name} incorrectly and so it will inject a ".eng" bit in the middle of the filename when processing subtitle files. It also doesn't account for undefined bindings, and so you might end up with [, , , 720p] in the specification bit for one file or another.
Re: Way to add LANGUAGE only when it isn't English?
This one seems to do exactly what I want, Rednoah! Thank u & Kim tremendously for your efforts! Best software in the world!rednoah wrote: ↑03 Feb 2022, 00:33 EDIT:
If you want to use the {plex} format but append to values to the movie / series folder name, then that would work like this:
Code: Select all
X:/Plex/{ plex * { allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']') } }
rednoah wrote: ↑12 Sep 2016, 10:03 e.g. Avatar (2009) [M19995]/Avatar (2009)Code: Select all
{ ~plex * " [M$id]" }

Re: Way to add LANGUAGE only when it isn't English?
One final question: I tried using the formula for series as well but noticed (obviously) that the 'director' tag had to be removed due to different directors for different seasons. Is it possible to add the year in your given formula? I was experimenting with the {y}-code but can't seem to get it implemented in my formula. Thx in advance!rednoah wrote: ↑03 Feb 2022, 01:15 I see. I'd start with this example from the {plex} format manual:and then copy & paste your specification list code:rednoah wrote: ↑12 Sep 2016, 10:03 e.g. Avatar (2009) [M19995]/Avatar (2009)Code: Select all
{ ~plex * " [M$id]" }
Code: Select all
X:/{ ~plex * { allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{director}{vf}.joining(', ', ' [', ']') } }
Alternatively, you can just add the { languages =~ /eng/ ? null : languages.name[0].upper() } bit into the format that you were previously happy with. I shall note though that your format uses {plex.name} incorrectly and so it will inject a ".eng" bit in the middle of the filename when processing subtitle files. It also doesn't account for undefined bindings, and so you might end up with [, , , 720p] in the specification bit for one file or another.
Re: Way to add LANGUAGE only when it isn't English?
Yes, you can just use y:
Code: Select all
X:/{ ~plex * { allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{y}{vf}.joining(', ', ' [', ']') } }
Code: Select all
X:/Firefly [Drama, 2002, 2160p]/Season 01/Firefly - S01E01 - Serenity
Re: Way to add LANGUAGE only when it isn't English?
Yeah, that one I figured out but I was having trouble with getting it like this:rednoah wrote: ↑03 Feb 2022, 14:20 Yes, you can just use y:Code: Select all
X:/{ ~plex * { allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{y}{vf}.joining(', ', ' [', ']') } }
Code: Select all
X:/Firefly [Drama, 2002, 2160p]/Season 01/Firefly - S01E01 - Serenity
So the renaming is similar to my movie scheme. Sorry for my OCD acting up! :'(Firefly (2002) [Drama, 2160p]/Season 01/Firefly - S01E01 - Serenity
Re: Way to add LANGUAGE only when it isn't English?
Hey Noah,rednoah wrote: ↑03 Feb 2022, 14:20 Yes, you can just use y:Code: Select all
X:/{ ~plex * { allOf{ languages =~ /eng/ ? null : languages.name[0].upper() }{genre}{y}{vf}.joining(', ', ' [', ']') } }
Code: Select all
X:/Firefly [Drama, 2002, 2160p]/Season 01/Firefly - S01E01 - Serenity
Any idea how to get the year as (XXXX) behind the movie name? Thx in advance!
Re: Way to add LANGUAGE only when it isn't English?
Use ny instead of n?
Re: Way to add LANGUAGE only when it isn't English?
If you're using {plex} for movies then you will always get Name (Year) naming by default.
Are we perhaps talking about TV Show naming and not Movie naming?
