The place to discuss how to make 23 work in special ways with the 23 api

photosets.create does not seem to use the primary_photo_id property

clvrmnky   February 24, 2011, 03:30 AM

I'm creating an album at the same time as I upload a new file. I make sure I get the photo ID of the new photo, and then pass than to photosets.create via primary_photo_id.

However, this does not seem to be setting the cover photo for the album automatically. In fact, in the /album/list view, the album shows as a broken "?" image, and the URL to the album thumbnail is .../photo//quad100

If I republish my image via /replace it eventually uses the image as the cover photo, but I'm hoping to solve why it does not work on the initial upload and create of the new photo ID.

I could hack around this by calling photosets.setPrimaryPhoto after I upload the image and create the album, but this REST call is not supported by 23.

Does anyone else see this?

For reference, this is the sequence of events:

1. /upload the photo via POST. See the successful response.
2. Call photos.getInfo on the new ID. Success.
3. Call photos.addTags (unnecessary here, but part of the standard upload so I can rationalize tags that may have changed later.) Success.
4. Call photosets.getList in order to see if I have to create or update an existing album. Success.
5. Call photosets.create with description and primary_photo_id (the same photoID I got, above.) Success.
6. Call photosets.addPhoto to make sure the photo is in the album. I think this is unnecessary on Flickr, but it can't hurt. Success. (If I interrupt the process before doing step 6, I still have the same problem.)

I've checked the response in all cases, and all the IDs I get back are the same as the ones I use in following calls.

When I add another photo to the album I call photosets.getInfo. I can see that the primary photo is the correct photoID of the original photo I uploaded.

[Later]

I guess I can try to use photosets.editPhotos instead of addPhotos when I create the album, and see if that solves the problem. I'll try that.

[Later]

Nope, editPhotos returns success, but the album still doesn't get a cover photo.

 
Steffen Tiedemann Christensen Team 23   February 27, 2011, 07:51 PM

Think the problem here was actually caching -- that the photo was added to the album and the cover photo/primary photo was set, but that this wasn't applied to the album setting before the next cache flush. I've updated the code now, and the fix will be available on the production servers within a few hours.

 
clvrmnky   February 28, 2011, 02:28 AM

Looks good at this end. Creating a photoset now gets the primary photo/album cover set.

Thanks!

 




About 23

About 23
What is 23 and who's behind the service?
Just In
Discover the world from a different angle.
Here's a crop of the latest photos from the around the world.
Search
Search photos from users using 23
Help / Discussion
Get help or share your ideas to make 23 better
23 Blog / 23 on Twitter
Messages and observations from Team 23
Terms of use
What can 23 be used for and what isn't allowed
More services from 23
We also help people use photo sharing in their professional lives
RSS Feed
Subscribe to these photos in an RSS reader
  • Basque (ES)
  • Bulgarian (BG)
  • Chinese (CN)
  • Chinese (TW)
  • Danish (DK)
  • Dutch (NL)
  • English (US)
  • French (FR)
  • Galician (ES)
  • German (DE)
  • Italian (IT)
  • Norwegian (NO)
  • Polish (PL)
  • Portuguese (PT)
  • Russian (RU)
  • Spanish (ES)
  • Swedish (SE)

Popular photos right now

See also