* fix stupids mistake...
This commit is contained in:
parent
2eeca8be77
commit
7bc9379671
|
@ -98,7 +98,7 @@ public class IMDbClient implements MovieIdentificationService {
|
||||||
try {
|
try {
|
||||||
int imdbid = getImdbId(selectString("//LINK[@rel='canonical']/@href", dom));
|
int imdbid = getImdbId(selectString("//LINK[@rel='canonical']/@href", dom));
|
||||||
Movie movie = getMovieDescriptor(imdbid, locale);
|
Movie movie = getMovieDescriptor(imdbid, locale);
|
||||||
if (movie == null) {
|
if (movie != null) {
|
||||||
results.add(movie);
|
results.add(movie);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -27,6 +27,18 @@ public class IMDbClientTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void searchMovieRedirect() throws Exception {
|
||||||
|
List<Movie> 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
|
@Test
|
||||||
public void getMovieDescriptor() throws Exception {
|
public void getMovieDescriptor() throws Exception {
|
||||||
Movie movie = imdb.getMovieDescriptor(499549, null);
|
Movie movie = imdb.getMovieDescriptor(499549, null);
|
||||||
|
|
Loading…
Reference in New Issue