only check documents

This commit is contained in:
j 2015-09-24 18:57:24 +01:00
parent 733b909981
commit ad7570c496

View file

@ -770,7 +770,7 @@ class Client(object):
],
'operator': '|'
},
'keys': ['item', 'id'],
'keys': ['item', 'id', 'extension'],
'range': [0, 5000]
})['data']['items']
d = self.api.findDocuments({
@ -781,11 +781,14 @@ class Client(object):
],
'operator': '|'
},
'keys': ['id', 'oshash'],
'keys': ['id', 'oshash', 'extension'],
'range': [0, len(files)]
})['data']['items']
available = set(f['oshash'] for f in d)
missing = [(f['id'], f['item']) for f in files if f['id'] not in available]
available = set(f['oshash']
for f in d if f['extension'] in DOCUMENT_FORMATS)
missing = [(f['id'], f['item']) for f in files \
if f['id'] not in available \
and f['extension'] in DOCUMENT_FORMATS]
return missing
def _add_document(self, f, item=None):