From 7bc9379671bf536914be2509f04a96ec3b28661f Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 18 Nov 2012 16:18:16 +0000 Subject: [PATCH] * fix stupids mistake... --- source/net/sourceforge/filebot/web/IMDbClient.java | 2 +- test/net/sourceforge/filebot/web/IMDbClientTest.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/web/IMDbClient.java b/source/net/sourceforge/filebot/web/IMDbClient.java index 69f3af15..8e632acb 100644 --- a/source/net/sourceforge/filebot/web/IMDbClient.java +++ b/source/net/sourceforge/filebot/web/IMDbClient.java @@ -98,7 +98,7 @@ public class IMDbClient implements MovieIdentificationService { try { int imdbid = getImdbId(selectString("//LINK[@rel='canonical']/@href", dom)); Movie movie = getMovieDescriptor(imdbid, locale); - if (movie == null) { + if (movie != null) { results.add(movie); } } catch (Exception e) { diff --git a/test/net/sourceforge/filebot/web/IMDbClientTest.java b/test/net/sourceforge/filebot/web/IMDbClientTest.java index b4478bc5..fa3ac978 100644 --- a/test/net/sourceforge/filebot/web/IMDbClientTest.java +++ b/test/net/sourceforge/filebot/web/IMDbClientTest.java @@ -27,6 +27,18 @@ public class IMDbClientTest { } + @Test + public void searchMovieRedirect() throws Exception { + List results = imdb.searchMovie("(500) Days of Summer (2009)", null); + + Movie movie = results.get(0); + + assertEquals("(500) Days of Summer", movie.getName()); + assertEquals(2009, movie.getYear()); + assertEquals(1022603, movie.getImdbId(), 0); + } + + @Test public void getMovieDescriptor() throws Exception { Movie movie = imdb.getMovieDescriptor(499549, null);