lib/ruby-tmdb/tmdb_movie.rb in ruby-tmdb-0.1.1 vs lib/ruby-tmdb/tmdb_movie.rb in ruby-tmdb-0.1.2
- old
+ new
@@ -34,10 +34,12 @@
return results
end
end
def self.new(raw_data, expand_results = false)
- raw_data = Tmdb.api_call('Movie.getInfo', raw_data["id"]).first if(expand_results)
+ # expand the result by calling Movie.getInfo unless :expand_results is false or the data is already complete
+ # (as determined by checking for the trailer property in the raw data)
+ raw_data = Tmdb.api_call('Movie.getInfo', raw_data["id"]).first if(expand_results && !raw_data.has_key?("trailer"))
return Tmdb.data_to_object(raw_data)
end
def ==(other)
return false unless(other.is_a?(TmdbMovie))
\ No newline at end of file