store metadata per user. remove primaryid. only store isbn13
This commit is contained in:
parent
90648f9e65
commit
02e040d9f5
16 changed files with 245 additions and 192 deletions
|
|
@ -132,18 +132,8 @@ def edit(data):
|
|||
for id in ids:
|
||||
item = models.Item.get(id)
|
||||
if item and item.json()['mediastate'] == 'available':
|
||||
if 'primaryid' in data:
|
||||
if data['primaryid']:
|
||||
key, value = data['primaryid']
|
||||
logger.debug('update primaryid %s %s', key, value)
|
||||
value = cleanup_id(key, value)
|
||||
item.update_primaryid(key, value)
|
||||
else:
|
||||
item.update_primaryid()
|
||||
response = item.json()
|
||||
else:
|
||||
item.edit_metadata(data)
|
||||
response = item.json()
|
||||
item.edit(data)
|
||||
response = item.json()
|
||||
edited.append(id)
|
||||
else:
|
||||
logger.info('can only edit available items %s', id)
|
||||
|
|
@ -264,8 +254,6 @@ def getMetadata(data):
|
|||
for key in [k['id'] for k in settings.config['itemKeys'] if isinstance(k['type'], list)]:
|
||||
if key in response and not isinstance(response[key], list):
|
||||
response[key] = [response[key]]
|
||||
if response:
|
||||
response['primaryid'] = [key, value]
|
||||
return response
|
||||
actions.register(getMetadata)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue