From de9d326eb0610edf160cb7bdb351b81e6bd9d549 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 22 Feb 2013 17:26:34 +0000 Subject: [PATCH] * fix video support in imdb scraper --- source/net/sourceforge/filebot/web/IMDbClient.java | 2 +- test/net/sourceforge/filebot/web/IMDbClientTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/web/IMDbClient.java b/source/net/sourceforge/filebot/web/IMDbClient.java index 4568173e..7cb0b49c 100644 --- a/source/net/sourceforge/filebot/web/IMDbClient.java +++ b/source/net/sourceforge/filebot/web/IMDbClient.java @@ -112,7 +112,7 @@ public class IMDbClient implements MovieIdentificationService { int imdbid = getImdbId(selectString("//LINK[@rel='canonical']/@href", dom)); String title = selectString("//META[@property='og:title']/@content", dom); - Matcher titleMatcher = Pattern.compile("(.+)\\s\\((?i:TV\\s)?(\\d{4})\\)$").matcher(title); + Matcher titleMatcher = Pattern.compile("(.+)\\s\\((?i:tv.|video.)?(\\d{4})\\)$").matcher(title); if (!titleMatcher.matches()) return null; diff --git a/test/net/sourceforge/filebot/web/IMDbClientTest.java b/test/net/sourceforge/filebot/web/IMDbClientTest.java index 1388abda..8aebcd63 100644 --- a/test/net/sourceforge/filebot/web/IMDbClientTest.java +++ b/test/net/sourceforge/filebot/web/IMDbClientTest.java @@ -133,6 +133,16 @@ public class IMDbClientTest { } + @Test + public void getMovieDescriptor5() throws Exception { + Movie movie = imdb.getMovieDescriptor(1020960, null); + + assertEquals("God, the Universe and Everything Else", movie.getName()); + assertEquals(1988, movie.getYear()); + assertEquals(1020960, movie.getImdbId(), 0); + } + + @Test public void getAkaMovieDescriptor() throws Exception { Movie movie = imdb.getMovieDescriptor(106559, Locale.ENGLISH);