This project has moved and is read-only. For the latest updates, please go here.

Trouble with Photoset.PhotoCollection

Topics: User Forum
Sep 19, 2006 at 2:08 PM
When I run the example from the tutorial everything works fine but when I try running through a set collection my application stops.

string sSearchUser = "some user";

// get user
FoundUser user = flickr.PeopleFindByUsername(sSearchUser);

// get sets
Photosets sets = flickr.PhotosetsGetList(user.UserId);

// foreach collection
foreach(Photoset set in sets.PhotosetCollection) {

// foreach photo
foreach (Photo pic in set.PhotoCollection) {
// print title


Any ideas?
Sep 27, 2006 at 4:27 PM
PhotosetsGetList does not return a list of photos, just a list of photosets.

If you wanted to return every photo in ever photoset you would have to make another call to Flickr to get the photos for each photoset.

foreach(Photoset set in sets.PhotosetCollection)
Photo[] photos = flickr.PhotosetsGetPhotos(set.PhotosetId);
foreach(Photo photo in photos)