lib/tmdb_party.rb in jduff-tmdb_party-0.0.2 vs lib/tmdb_party.rb in jduff-tmdb_party-0.1.0

- old
+ new

@@ -22,10 +22,17 @@ data['results']['moviematches']['movie'].collect do |movie| Movie.new(movie, self) end end - def imdb_lookup(id) + def imdb_lookup(imdb_id) + data = self.class.get('/Movie.imdbLookup', :query=>{:imdb_id=>imdb_id}) + case data['results']['moviematches']['movie'] + when String + return nil + when Hash + Movie.new(data['results']['moviematches']['movie'], self) + end end def get_info(id) data = self.class.get('/Movie.getInfo', :query=>{:id=>id}) Movie.new(data['results']['moviematches']['movie'], self) \ No newline at end of file