commonthread-flickr_fu 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/flickr_fu.gemspec +1 -1
- data/lib/flickr/photo.rb +5 -5
- data/lib/flickr_fu.rb +2 -1
- metadata +1 -1
data/flickr_fu.gemspec
CHANGED
data/lib/flickr/photo.rb
CHANGED
@@ -76,7 +76,7 @@ class Flickr::Photos::Photo
|
|
76
76
|
# :original - original image, either a jpg, gif or png, depending on source format
|
77
77
|
#
|
78
78
|
def save_as(filename, size = :medium)
|
79
|
-
format = size.to_sym == :original ? self.original_format : 'jpg'
|
79
|
+
format = size.to_sym == :original ? (self.original_format || 'jpg') : 'jpg'
|
80
80
|
filename = "#{filename}.#{format}"
|
81
81
|
|
82
82
|
if File.exists?(filename) or not self.url(size)
|
@@ -186,12 +186,10 @@ class Flickr::Photos::Photo
|
|
186
186
|
@comments ||= begin
|
187
187
|
if @comment_count == 0
|
188
188
|
self.comments = []
|
189
|
-
|
190
|
-
elsif not self.comments_added
|
189
|
+
else
|
191
190
|
rsp = @flickr.send_request('flickr.photos.comments.getList', :photo_id => self.id)
|
192
191
|
|
193
192
|
self.comments = []
|
194
|
-
self.comments_added = true
|
195
193
|
|
196
194
|
rsp.comments.comment.each do |comment|
|
197
195
|
self.comments << Flickr::Photos::Comment.new(:id => comment[:id],
|
@@ -201,7 +199,9 @@ class Flickr::Photos::Photo
|
|
201
199
|
:permalink => comment[:permalink],
|
202
200
|
:created_at => (Time.at(comment[:datecreate].to_i) rescue nil))
|
203
201
|
end
|
204
|
-
end
|
202
|
+
end
|
203
|
+
|
204
|
+
self.comments
|
205
205
|
end
|
206
206
|
end
|
207
207
|
|
data/lib/flickr_fu.rb
CHANGED