Update paths and filenames in db in a single transaction

This commit is contained in:
Kovid Goyal 2023-04-06 11:08:03 +05:30
parent 31b92d6ab8
commit dd186d060d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1775,6 +1775,7 @@ 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
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)