mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-29 20:45:33 +01:00
Correctly map classifier to identifiers in json_codec (I think)
This commit is contained in:
parent
27e95b8675
commit
ec6c18137b
1 changed files with 4 additions and 2 deletions
|
|
@ -119,12 +119,12 @@ def decode_from_file(self, file, booklist, book_class, prefix):
|
|||
for item in js:
|
||||
book = book_class(prefix, item.get('lpath', None))
|
||||
for key in item.keys():
|
||||
if key == 'classifiers':
|
||||
key = 'identifiers'
|
||||
meta = self.decode_metadata(key, item[key])
|
||||
if key == 'user_metadata':
|
||||
book.set_all_user_metadata(meta)
|
||||
else:
|
||||
if key == 'classifiers':
|
||||
key = 'identifiers'
|
||||
setattr(book, key, meta)
|
||||
booklist.append(book)
|
||||
except:
|
||||
|
|
@ -132,6 +132,8 @@ def decode_from_file(self, file, booklist, book_class, prefix):
|
|||
traceback.print_exc()
|
||||
|
||||
def decode_metadata(self, key, value):
|
||||
if key == 'classifiers':
|
||||
key = 'identifiers'
|
||||
if key == 'user_metadata':
|
||||
for k in value:
|
||||
if value[k]['datatype'] == 'datetime':
|
||||
|
|
|
|||
Loading…
Reference in a new issue