Does not recognize the {vs} or {source} in a few files

All about user-defined episode / movie / file name format expressions
Post Reply
kenar
Posts: 2
Joined: 27 Apr 2022, 15:43

Does not recognize the {vs} or {source} in a few files

Post by kenar »

Hi.
I have this movie

Code: Select all

The Amazing Spider-Man 2 (2014) [BDRemux 1080p AVC DUAL DTS 5.1 Subs].mkv
and I want to pass it to this format

Code: Select all

Action/The Amazing Spider-Man 2 (2014) [BDRemux 1080p].mkv
the code I use is this, but it tells me that Vs and sourde is undefined

Code: Select all

{genre}/{source}/
{ny.replace(':', ' -')}    
{ 
    (hd == 'SD') ? {any{text.size()}{0} > 0 ? '[SD][Dual]':'[SD][ES]'} :
    (hd == 'UHD') ? ( ((bytes/1073741824).round(1) > 30 && bitrate >= 26000000 ?  '{tmdb-'+ tmdbid +'} ['+vs+' 2160p]' : {any{text.size()}{0} > 0 ?  '{tmdb-'+ tmdbid +'} ['+vs+' 2160p]': '{tmdb-'+ tmdbid +'}['+vs+' 2160p]'})) :
    (hd == 'HD' && vf == '720p') ? {any{text.size()}{0} > 0 ? '{tmdb-ID} ['+vs+' 720p]':' {tmdb-ID}['+vs+' 720p]'} :
    (hd == 'HD' && vf == '1080p' ?
            ((bytes/1073741824).round(1) > 15 && bitrate >= 18000000) ? '{tmdb-'+ tmdbid +'} ['+vs+' 1080p]' :
            (bitrate > 8000000) ? {any{text.size()}{0} > 0 ? '{tmdb-'+ tmdbid +'} ['+vs+' 1080p]': '{tmdb-'+ tmdbid +'} ['+vs+' 1080p]'} : {any{text.size()}{0} > 0 ?  '{tmdb-'+ tmdbid +'} ['+vs+' 1080p]': '{tmdb-'+ tmdbid +'} ['+vs+' 1080p]'} :
            {any{text.size()}{0} > 0 ? tmdbid +' 1 ['+vs+' 1080p]':tmdbid +' 2 ['+vs+' 1080p]'}          
    )
}{(genres.contains('Animación')) ? '[Animación]' : '' }
can you help me, thanks
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Does not recognize the {vs} or {source} in a few files

Post by rednoah »

:?: What is the {source} value do you expect for the file name above? BDRemux? BluRay?


:idea: FileBot will guess {source} by checking for keywords in the file path, and MediaInfo media title property, and thus may not work for all files since since it cannot be reliably inferred from video / audio properties:
viewtopic.php?t=11265
:idea: Please read the FAQ and How to Request Help.
kenar
Posts: 2
Joined: 27 Apr 2022, 15:43

Re: Does not recognize the {vs} or {source} in a few files

Post by kenar »

Hello
I have seen this post but I don't know how to program in this language very well. which? to find information on how things are done.

What I have been thinking about is to make a variable and put an if that if {vs} contains "BDRemux" I put it by hand and if not {vs} and use the rest of the code the created variable.
I have seen this code but I don't know how to put the src variable in my code

Code: Select all

String src
if (['BDRemux'].contains(vs) {
  src = "BDRemux"
} else {
  src = vs
} 
How can I do it?

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

Re: Does not recognize the {vs} or {source} in a few files

Post by rednoah »

:idea: The if-then-else logic you are trying to express seems to be this, but that probably won't do anything, and especially won't work if {vs} is undefined:

Code: Select all

vs == /BDRemux/ ? /BDRemux/ : vs
:arrow: viewtopic.php?t=4191



:arrow: You probably mean to write "if the file name contains BDRemux then return BDRemux; otherwise return vs by default" and that would look like this:

Code: Select all

fn =~ /BDRemux/ ? /BDRemux/ : vs
:idea: Please read the FAQ and How to Request Help.
Post Reply