1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-17 06:45:06 -05:00

* 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

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);
}