bbolli / tumblr-utils

Utilities for dealing with Tumblr blogs, Tumblr backup
GNU General Public License v3.0
668 stars 124 forks source link

Bug: number of posts saved does not match what is requested #15

Closed WyohKnott closed 10 years ago

WyohKnott commented 10 years ago

Hello,

Since the merge of gh-13, I have found a new bug:

tumblr_backup.py -n 49 account
account: 49 posts backed up
tumblr_backup.py -n 50 account
account: 20 posts backed up
tumblr_backup.py -n 80 account
account: 80 posts backed up
tumblr_backup.py -n 100 account
account: 40 posts backed up

It seems each time the script hits a multiple of 50, it only saves 20 posts.

I thought it was from the enhancements I've proposed, but the culprit seems to be located in this commit https://github.com/bbolli/tumblr-utils/commit/ae72b60bb37c50f60a6a10c906049aa23d04193d :

WyohKnott commented 10 years ago

In the new code

    if count != MAX_POSTS:
        params['num'] = count

So if count = 50 or a multiple of 50, params['num'] = count is ignored and therefore the API default is used, i.e. 20. It probably should be:

    if count <= MAX_POSTS:
        params['num'] = count