Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Jul 30, 2024
1 parent f3420c6 commit bcd0ab1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/calibre/db/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,10 @@ def transform_format_filenames(src_path, dest_path):

def copy_extra_file_to(self, book_id, book_path, relpath, stream_or_path):
full_book_path = os.path.abspath(os.path.join(self.library_path, book_path))
src_path = make_long_path_useable(os.path.join(full_book_path, relpath))
extra_file_path = os.path.abspath(os.path.join(full_book_path, relpath))
if not extra_file_path.startswith(full_book_path):
raise FileNotFoundError(f'No data file {relpath} in book: {book_id}')
src_path = make_long_path_useable(extra_file_path)
if isinstance(stream_or_path, str):
shutil.copy2(src_path, make_long_path_useable(stream_or_path))
else:
Expand Down

0 comments on commit bcd0ab1

Please sign in to comment.