From a1edacd382b1ca0b15ec1f76a6c2adea487f6708 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 11 Mar 2012 22:00:41 +0100 Subject: [PATCH] sent all info in db --- pandora_client/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index 79f7144..54c8c23 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -409,14 +409,18 @@ class Client(object): info = r['data']['info'] max_info = 100 total = len(info) - print 'sending info for %s files' % total + sent = 0 for offset in range(0, total, max_info): post = {'info': {}, 'upload': True} for oshash in info[offset:offset+max_info]: - if oshash in files['info']: - post['info'][oshash] = files['info'][oshash] + _info = self.info(oshash) + if _info: + post['info'][oshash] = _info if len(post['info']): r = self.api.update(post) + sent += len(post['info']) + if sent: + print 'sent info for %s files' % sent if not 'data' in r: print r