mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-02-05 23:21:07 -05:00
Pass set to member.flickr_photos - broken\!
This commit is contained in:
@@ -33,7 +33,7 @@ class PhotosController < ApplicationController
|
||||
@flickr_auth = current_member.auth('flickr')
|
||||
if @flickr_auth
|
||||
@sets = current_member.flickr_sets
|
||||
photos = current_member.flickr_photos(page)
|
||||
photos = current_member.flickr_photos(page, params[:set])
|
||||
total = photos.instance_of?(FlickRaw::ResponseList) ? photos.total : 0
|
||||
|
||||
@photos = WillPaginate::Collection.create(page, 30, total) do |pager|
|
||||
|
||||
@@ -150,12 +150,20 @@ class Member < ActiveRecord::Base
|
||||
end
|
||||
|
||||
# Fetches a collection of photos from Flickr
|
||||
def flickr_photos(page_num=1)
|
||||
return flickr.people.getPhotos(
|
||||
:user_id => 'me',
|
||||
:page => page_num,
|
||||
:per_page => 30
|
||||
)
|
||||
def flickr_photos(page_num=1, set=nil)
|
||||
if set
|
||||
return flickr.photosets.getPhotos(
|
||||
:photoset_id => set,
|
||||
:page => page_num,
|
||||
:per_page => 30
|
||||
)
|
||||
else
|
||||
return flickr.people.getPhotos(
|
||||
:user_id => 'me',
|
||||
:page => page_num,
|
||||
:per_page => 30
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns a hash of Flickr photosets' ids and titles
|
||||
|
||||
Reference in New Issue
Block a user