lib/smile/photo.rb in smile-0.4.0 vs lib/smile/photo.rb in smile-0.4.1
- old
+ new
@@ -30,10 +30,13 @@
image = web_method_call(
{ :method => 'smugmug.images.getInfo' },
options
)
+ image = image['image']
+ logger.info( image )
+
image.merge!( :image_id => image["id"] )
image.merge!( :album_key => image["album"]["key"] )
image.merge!( :album_id => image["album"]["id"] )
image.delete( 'album' )
@@ -187,8 +190,13 @@
OpenStruct.new( image )
end
def album
- Smile::Album.find( :AlbumID => self.album_id, :AlbumKey => self.album_key )
+ @album ||= Smile::Album.find( :AlbumID => self.album_id, :AlbumKey => self.album_key )
+ end
+
+ def reload!
+ @attributes = Smile::Photo.find( { :ImageID => self.image_id, :ImageKey => self.key } ).attributes
+ self
end
end