How can make: If ($$6 is empty) Regex1 Else Regex2

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
muttley:bd Offline
Senior Member
Posts: 141
Joined: Oct 2008
Reputation: 0
Post: #1
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
[INDENT]2.1 - Search on tmdb with "normal" film title[/INDENT]
3 - else
[INDENT]3.1 - search on tmdb with original film title[/INDENT]
4 - Get backdrops of first film reported

thanks!

i'm italian, sorry for my bad english!
(This post was last modified: 2009-09-14 19:29 by muttley:bd.)
find quote
spiff Offline
Grumpy Bastard Developer
Posts: 12,181
Joined: Nov 2003
Reputation: 82
Post: #2
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.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
muttley:bd Offline
Senior Member
Posts: 141
Joined: Oct 2008
Reputation: 0
Post: #3
waoooo...you are very speedy!!

Good idea...thank you!!
find quote