mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
2585745fde
commit
d6b602a085
@ -3453,9 +3453,8 @@ def import_library(library_key, importer, library_path, progress=None, abort=Non
|
|||||||
if abort is not None and abort.is_set():
|
if abort is not None and abort.is_set():
|
||||||
return
|
return
|
||||||
with open(os.path.join(library_path, 'metadata.db'), 'wb') as f:
|
with open(os.path.join(library_path, 'metadata.db'), 'wb') as f:
|
||||||
src = importer.start_file(metadata['metadata.db'], 'metadata.db for ' + library_path)
|
with closing(importer.start_file(metadata['metadata.db'], 'metadata.db for ' + library_path)) as src:
|
||||||
shutil.copyfileobj(src, f)
|
shutil.copyfileobj(src, f)
|
||||||
src.close()
|
|
||||||
if 'full-text-search.db' in metadata:
|
if 'full-text-search.db' in metadata:
|
||||||
if progress is not None:
|
if progress is not None:
|
||||||
progress('full-text-search.db', 1, total)
|
progress('full-text-search.db', 1, total)
|
||||||
@ -3463,9 +3462,8 @@ def import_library(library_key, importer, library_path, progress=None, abort=Non
|
|||||||
return
|
return
|
||||||
poff += 1
|
poff += 1
|
||||||
with open(os.path.join(library_path, 'full-text-search.db'), 'wb') as f:
|
with open(os.path.join(library_path, 'full-text-search.db'), 'wb') as f:
|
||||||
src = importer.start_file(metadata['full-text-search.db'], 'full-text-search.db for ' + library_path)
|
with closing(importer.start_file(metadata['full-text-search.db'], 'full-text-search.db for ' + library_path)) as src:
|
||||||
shutil.copyfileobj(src, f)
|
shutil.copyfileobj(src, f)
|
||||||
src.close()
|
|
||||||
if abort is not None and abort.is_set():
|
if abort is not None and abort.is_set():
|
||||||
return
|
return
|
||||||
if 'notes.db' in metadata:
|
if 'notes.db' in metadata:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user