Kodi Community Forum

Full Version: How can make: If ($$6 is empty) Regex1 Else Regex2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry for title, i would be clear Wink

I'm updating the MyMovies.xml scraper...now don't work beacause site have change graphic.

The problem:

I would implement GetTmdbBackdrops Function, but i don't have imdb id.
I must search in the tmdb (through api) with film name, but MyMovies is an italian films db and the title is translated in italian language.
Any time there is the original title, but not always, because not always there is a difference from original and italian title...

I would made something like this:

1 - Get Original film Title (from mymovies.it)
2 - If regular expression don't match => No Original title
2.1 - Search on tmdb with "normal" film title
3 - else
3.1 - search on tmdb with original film title
4 - Get backdrops of first film reported

thanks!

i'm italian, sorry for my bad english!
if you have the (potentially blank) result in some buffer, let us say $$4, and the normal title in, say $$5, something like this would cut it

Code:
<RegExp input="$$4" output="\1" dest="5">
  <expression>(.+)</expression>
</RegExp>
<RegExp input="$$5" output="<url function="blablabla">someurl\1</url>" dest="1">
  <expression/>
</RegExp>

the first expression will only match IF $$4 is not blank, thereby overwriting whatever's stored in $$5. this is obviously not to be copied verbatim, as i've cheated wrt escaping chars etc.
waoooo...you are very speedy!!

Good idea...thank you!!