Check if photoset exists

Jan 9, 2011 at 6:59 PM

Hi,

how do I check if a speciffic photoset already exists? I have this code:

PhotosetCollection sets = flickr.PhotosetsGetList();
foreach (Photoset s in sets)
{
    //check for the photoset
}

is there a better way to do this (except for using a while statement :))

 

Coordinator
Jan 9, 2011 at 7:08 PM

What are you checking? The photoset title? I would recommend populating a drop down with the list of photosets rather than trying to get a user to manually enter the title by hand.

If all you have is the title then no, there is no other way to check a photoset exists.

Sam

Jan 9, 2011 at 7:16 PM

Thank you for the reply.

I am creating a "bulk upload" function where you select some root folder. All jpg files in the root folder and subfolders are uploaded to flickr. all files in each folder is assigned to a photoset with a title that equals the original filepath - etc. c:\temp\2010\1.jpg is assigned to a photoset with the title c-temp-2010.

Before creating the photoset I would like to check if it already exists. What would happen if I create a photoset that already exists?

Sorry if my question is straight forward but I have not been programming C# for a few years.

/Thomas

Coordinator
Jan 10, 2011 at 7:44 AM

In that case no, there is no quicker way of seeing if a photoset exists.

I would recommend getting the list of photosets only once when your program first runs, rather than fetching it everytime.

If a photoset already exists with the same name I suspect Flickr will still allow the new photoset to be created - it will just have a different photoset id as the first one.

Sam