mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-09 21:54:28 +01:00
Handle code passing an OPF object into db.set_metadata
This commit is contained in:
parent
f9bddf4f67
commit
63b72a9b4f
1 changed files with 4 additions and 0 deletions
|
|
@ -1254,6 +1254,10 @@ def set_metadata(self, id, mi, ignore_errors=False,
|
|||
'''
|
||||
Set metadata for the book `id` from the `Metadata` object `mi`
|
||||
'''
|
||||
if hasattr(mi, 'to_book_metadata'):
|
||||
# Handle code passing in a OPF object instead of a Metadata object
|
||||
mi = mi.to_book_metadata()
|
||||
|
||||
def doit(func, *args, **kwargs):
|
||||
try:
|
||||
func(*args, **kwargs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue