mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -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,
|
self.copy_format_to(book_id, fmt, ofmt_fname, current_path,
|
||||||
dest, windows_atomic_move=wam, use_hardlink=True)
|
dest, windows_atomic_move=wam, use_hardlink=True)
|
||||||
# Update db to reflect new file locations
|
# Update db to reflect new file locations
|
||||||
for fmt in formats:
|
with self.conn:
|
||||||
formats_field.table.set_fname(book_id, fmt, fname, self)
|
for fmt in formats:
|
||||||
path_field.table.set_path(book_id, path, self)
|
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
|
# Delete not needed files and directories
|
||||||
if source_ok:
|
if source_ok:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user