@@ -313,7 +313,23 @@ public Photoset getInfo(String photosetId) throws FlickrException {
313313 * @throws FlickrException
314314 */
315315 public Photosets getList (String userId ) throws FlickrException {
316- return getList (userId , 0 , 0 );
316+ return getList (userId , 0 , 0 , null );
317+ }
318+
319+ /**
320+ * Get a list of all photosets for the specified user.
321+ *
322+ * This method does not require authentication. But to get a Photoset into the list, that contains just private photos, the call needs to be authenticated.
323+ *
324+ * @param userId
325+ * The User id
326+ * @param primaryPhotoExtras
327+ * A comma-delimited list of extra information to fetch for the primary photo
328+ * @return The Photosets collection
329+ * @throws FlickrException
330+ */
331+ public Photosets getList (String userId , String primaryPhotoExtras ) throws FlickrException {
332+ return getList (userId , 0 , 0 , primaryPhotoExtras );
317333 }
318334
319335 /**
@@ -327,10 +343,12 @@ public Photosets getList(String userId) throws FlickrException {
327343 * The number of photosets per page
328344 * @param page
329345 * The page offset
346+ * @param primaryPhotoExtras
347+ * A comma-delimited list of extra information to fetch for the primary photo
330348 * @return The Photosets collection
331349 * @throws FlickrException
332350 */
333- public Photosets getList (String userId , int perPage , int page ) throws FlickrException {
351+ public Photosets getList (String userId , int perPage , int page , String primaryPhotoExtras ) throws FlickrException {
334352 Map <String , Object > parameters = new HashMap <String , Object >();
335353 parameters .put ("method" , METHOD_GET_LIST );
336354
@@ -346,6 +364,10 @@ public Photosets getList(String userId, int perPage, int page) throws FlickrExce
346364 parameters .put ("page" , String .valueOf (page ));
347365 }
348366
367+ if (primaryPhotoExtras != null ) {
368+ parameters .put ("primary_photo_extras" , primaryPhotoExtras );
369+ }
370+
349371 Response response = transportAPI .get (transportAPI .getPath (), parameters , apiKey , sharedSecret );
350372 if (response .isError ()) {
351373 throw new FlickrException (response .getErrorCode (), response .getErrorMessage ());
@@ -368,7 +390,13 @@ public Photosets getList(String userId, int perPage, int page) throws FlickrExce
368390 owner .setId (photosetElement .getAttribute ("owner" ));
369391 photoset .setOwner (owner );
370392
371- Photo primaryPhoto = new Photo ();
393+ Element primaryPhotoExtrasEl = XMLUtilities .getChild (photosetElement , "primary_photo_extras" );
394+ Photo primaryPhoto ;
395+ if (primaryPhotoExtrasEl != null ) {
396+ primaryPhoto = PhotoUtils .createPhoto (primaryPhotoExtrasEl );
397+ } else {
398+ primaryPhoto = new Photo ();
399+ }
372400 primaryPhoto .setId (photosetElement .getAttribute ("primary" ));
373401 primaryPhoto .setSecret (photosetElement .getAttribute ("secret" )); // TODO verify that this is the secret for the photo
374402 primaryPhoto .setServer (photosetElement .getAttribute ("server" )); // TODO verify that this is the server for the photo
0 commit comments