* make imdb binding return tt1234567 pattern values

* support {tmdbid} binding
This commit is contained in:
Reinhard Pointner 2012-12-29 17:41:07 +00:00
parent 2dc7fad7bd
commit 618e566e3f
1 changed files with 18 additions and 1 deletions

View File

@ -172,6 +172,23 @@ public class MediaBindingBean {
}
@Define("tmdbid")
public String getTmdbId() throws Exception {
int tmdbid = getMovie().getTmdbId();
if (tmdbid <= 0) {
if (getMovie().getImdbId() <= 0) {
return null;
}
// lookup IMDbID for TMDbID
tmdbid = WebServices.TMDb.getMovieInfo(getMovie(), null).getId();
}
return String.valueOf(tmdbid);
}
@Define("imdbid")
public String getImdbId() throws Exception {
int imdbid = getMovie().getImdbId();
@ -185,7 +202,7 @@ public class MediaBindingBean {
imdbid = WebServices.TMDb.getMovieInfo(getMovie(), null).getImdbId();
}
return String.format("%07d", imdbid);
return String.format("tt%07d", imdbid);
}