* updated to Media.getInfo method in TheMovieDB api client

This commit is contained in:
Reinhard Pointner 2010-11-01 10:23:56 +00:00
parent 18197999ed
commit d092b6f609
2 changed files with 10 additions and 5 deletions

View File

@ -50,7 +50,12 @@ public class TMDbClient implements MovieIdentificationService {
public List<MovieDescriptor> searchMovie(File file) throws IOException, SAXException { public List<MovieDescriptor> searchMovie(File file) throws IOException, SAXException {
return getMovies("Hash.getInfo", OpenSubtitlesHasher.computeHash(file)); return searchMovie(OpenSubtitlesHasher.computeHash(file), file.length());
}
public List<MovieDescriptor> searchMovie(String hash, long bytesize) throws IOException, SAXException {
return getMovies("Media.getInfo", hash + "/" + bytesize);
} }

View File

@ -28,12 +28,12 @@ public class TMDbClientTest {
@Test @Test
public void searchByHash() throws Exception { public void searchByHash() throws Exception {
List<MovieDescriptor> results = tmdb.getMovies("Hash.getInfo", "2bba5c34b007153b"); List<MovieDescriptor> results = tmdb.searchMovie("907172e7fe51ba57", 742086656);
MovieDescriptor movie = results.get(0); MovieDescriptor movie = results.get(0);
assertEquals("Season 1", movie.getName()); assertEquals("Sin City", movie.getName());
assertEquals(2002, movie.getYear()); assertEquals(2005, movie.getYear());
assertEquals(303461, movie.getImdbId()); assertEquals(401792, movie.getImdbId());
} }