Thanks Mike, that does help explain the behavior. I can indeed just ignore totalResults and page through the results. I noticed something a little odd with the paging, though. For my account with 75 photos, if I do this:
https://picasaweb.google.com/data/feed/api/user/default?kind=photo&max-results=75 ...then I correctly get 75 photos in the results. But, since I can't rely on totalResults to determine how many photos actually exist, my code can't know whether I got 75 photos because there are actually more than 75 photos (because I requested a max of 75), or if there are actually exactly 75 in the account. So I have no choice but to try again, but with a start-index of 76, like this: https://picasaweb.google.com/data/feed/api/user/default?kind=photo&max-results=75&start-index=76 But! In that case, I get all 75 photos again. If the start index is out of bounds, as 76 clearly is, I would expect 0 photos returned, or perhaps an error, but certainly not some non-zero number of photos. So I guess I'm going to have to keep track of all the photos I've seen and quit the paging logic as soon as I see a duplicate photo ID...assuming the photos are always returned in the same order, which I very much hope they are! thanks, Chris On Wednesday, November 28, 2012 12:05:38 PM UTC-5, Mike Erickson wrote: > > Hello Chris, > > I did some digging, and we might hope to resolve at some point in the > future when we transition to a different storage backend. The number that > is reported in totalResults is essentially a guess of how many photos * > might* be returned if they were all returned, although the actual number > is likely to not be that value because there is some filtering that happens > after the results are fetched but before the actual results are returned. > > I'm not sure how people use the totalResults or what kinds of problems > this would cause. If you use totalResults as an estimate, and page through > the results with a reasonable page window, you should be able to view the > photos until you have returned all the photos. > > I hope that at least helps a little, perhaps only to shed a little light. > > Thank you, > -Mike > > > On Tue, Nov 27, 2012 at 2:15 PM, Chris Bartley <[email protected]<javascript:> > > wrote: > >> The API >> docs<https://developers.google.com/picasa-web/docs/2.0/developers_guide_java#ListPhotos>say >> that an URL like this... >> >> https://picasaweb.google.com/data/feed/api/user/*username*?kind=photo >> >> ...will "retrieve the latest photos uploaded by username" (unfortunately >> with no definition as to what "latest" means, or how to specify a time >> range). However, when I try, I get wildly inconsistent results, especially >> with regards to the openSearch.totalResults field. I have 75 photos in >> my account, but the openSearch.totalResults field is *never* 75 for me, >> but rather always something smaller like 65, 68, or 71. I'm apparently not >> the only one with this problem, because the exact same behavior was >> reported in issue >> 2403<http://code.google.com/p/gdata-issues/issues/detail?id=2403> >> ...over *two years* ago. And, from what I can tell, issue >> 2825<http://code.google.com/p/gdata-issues/issues/detail?id=2825>is related. >> >> Since this problem is apparently over two years old, I'm not holding my >> breath for a fix any time soon, so how do people actually use the API to >> retrieve photos if you can't rely on totalResults being correct or >> consistent? Is there a workaround? Or am I just misunderstanding the API? >> >> thanks, >> >> Chris >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Picasa Web Albums API" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/google-picasa-data-api/-/JvY2MKE2BpAJ. >> To post to this group, send email to >> [email protected]<javascript:> >> . >> To unsubscribe from this group, send email to >> [email protected] <javascript:>. >> For more options, visit this group at >> http://groups.google.com/group/google-picasa-data-api?hl=en. >> > > -- You received this message because you are subscribed to the Google Groups "Google Picasa Web Albums API" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-picasa-data-api/-/pAT7ZZ-VICgJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-picasa-data-api?hl=en.
