mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Update paths and filenames in db in a single transaction
This commit is contained in:
parent
31b92d6ab8
commit
dd186d060d
@ -1775,9 +1775,10 @@ class DB:
|
||||
self.copy_format_to(book_id, fmt, ofmt_fname, current_path,
|
||||
dest, windows_atomic_move=wam, use_hardlink=True)
|
||||
# Update db to reflect new file locations
|
||||
for fmt in formats:
|
||||
formats_field.table.set_fname(book_id, fmt, fname, self)
|
||||
path_field.table.set_path(book_id, path, self)
|
||||
with self.conn:
|
||||
for fmt in formats:
|
||||
formats_field.table.set_fname(book_id, fmt, fname, self)
|
||||
path_field.table.set_path(book_id, path, self)
|
||||
|
||||
# Delete not needed files and directories
|
||||
if source_ok:
|
||||
|
Loading…
x
Reference in New Issue
Block a user