remotemetadata cleanup
- dont overwrite metadata if lookup does not return anything - make find fail without error
This commit is contained in:
parent
0ec527dd02
commit
67788f2a04
2 changed files with 4 additions and 3 deletions
|
@ -321,6 +321,7 @@ class Item(db.Model):
|
|||
logger.debug('scrape %s', primaryid)
|
||||
if primaryid:
|
||||
m = meta.lookup(*primaryid)
|
||||
if m:
|
||||
m['primaryid'] = primaryid
|
||||
self.meta = m
|
||||
self.update()
|
||||
|
|
|
@ -23,7 +23,7 @@ def request(action, data):
|
|||
|
||||
def find(query):
|
||||
logger.debug('find %s', query)
|
||||
return request('findMetadata', {'query': query})['items']
|
||||
return request('findMetadata', {'query': query}).get('items', [])
|
||||
|
||||
def lookup(key, value):
|
||||
logger.debug('lookup %s %s', key, value)
|
||||
|
|
Loading…
Reference in a new issue