lib/flickr/photos.rb in flickr-fu-0.1.3 vs lib/flickr/photos.rb in flickr-fu-0.1.4

- old
+ new

@@ -111,20 +111,21 @@ # Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500. # * page (Optional) # The page of results to return. If this argument is omitted, it defaults to 1. # def search(options) - options.merge!({:extras => "license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo,tags,machine_tags,o_dims,views"}) + options.merge!({:extras => "license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo,tags,machine_tags,o_dims,views,media"}) rsp = @flickr.send_request('flickr.photos.search', options) returning PhotoResponse.new(:page => rsp.photos[:page].to_i, :pages => rsp.photos[:pages].to_i, :per_page => rsp.photos[:perpage].to_i, :total => rsp.photos[:total].to_i, - :photos => [], :api => self, - :method => 'flickr.photos.search', + :photos => [], + :api => self, + :method => 'search', :options => options) do |photos| rsp.photos.photo.each do |photo| attributes = {:id => photo[:id], :owner => photo[:owner], :secret => photo[:secret], @@ -143,11 +144,12 @@ :updated_at => (Time.at(photo[:lastupdate].to_i) rescue nil), :geo => photo[:geo], :tags => photo[:tags], :machine_tags => photo[:machine_tags], :o_dims => photo[:o_dims], - :views => photo[:views].to_i} + :views => photo[:views].to_i, + :media => photo[:media]} photos << Photo.new(@flickr, attributes) end if rsp.photos.photo end end @@ -162,11 +164,11 @@ # Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500. # * page (Optional) # The page of results to return. If this argument is omitted, it defaults to 1. # def get_recent(options) - options.merge!({:extras => "license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo,tags,machine_tags,o_dims,views"}) + options.merge!({:extras => "license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo,tags,machine_tags,o_dims,views,media"}) rsp = @flickr.send_request('flickr.photos.getRecent', options) returning PhotoResponse.new(:page => rsp.photos[:page].to_i, :pages => rsp.photos[:pages].to_i, @@ -194,10 +196,11 @@ :updated_at => (Time.at(photo[:lastupdate].to_i) rescue nil), :geo => photo[:geo], :tags => photo[:tags], :machine_tags => photo[:machine_tags], :o_dims => photo[:o_dims], - :views => photo[:views].to_i} + :views => photo[:views].to_i, + :media => photo[:media]} photos << Photo.new(@flickr, attributes) end if rsp.photos.photo end end