google-code-export / django-syncr

Automatically exported from code.google.com/p/django-syncr
0 stars 0 forks source link

Flickr sync logic error? #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
app/flickr.py
syncAllPublic and syncRecentPhotos are using quite the same routine to
retrieve the pages for updating:

# syncAllPublic 
pages = int(math.ceil(count / 500))
for page in range(1, pages + 1):
    blahblah....

# syncRecentPhotos 
page_count = result.photos[0]['pages']
for page in range(1, int(page_count)+1):
    blahblah...

So if the user has less than 500 photos, the pages and the page_count will
be 0 and that would never trigger the for loop for updating.

I tried to make pages and page_count self_increased by 1 for both function
and actually get the fuctions working.

Original issue reported on code.google.com by vixvix...@gmail.com on 7 Feb 2009 at 9:09

GoogleCodeExporter commented 9 years ago
Ran into this as well. Simple patch to deal with photosets < 500 attached.

Original comment by cosf...@gmail.com on 14 Apr 2009 at 10:35

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch. I've checked it out and applied it. I'm pretty sure the 
original post was implying that 
syncAllPublic was broken and syncRecentPhotos was not. I looked over both 
methods to verify and I think they 
should work, despite using different routines. Let me know if this isn't the 
case...

Original comment by jesse.l...@gmail.com on 15 Apr 2009 at 12:42