Don't add unchanged paths to the rename_map.

master
Ethan Dalool 2019-08-18 22:39:02 -07:00
parent 87f1de1dc5
commit 34ce1bac56
1 changed files with 3 additions and 2 deletions

View File

@ -877,8 +877,9 @@ class Epub:
os.makedirs(directory.absolute_path, exist_ok=True) os.makedirs(directory.absolute_path, exist_ok=True)
new_filepath = directory.with_child(old_filepath.basename) new_filepath = directory.with_child(old_filepath.basename)
rename_map[old_filepath] = new_filepath if new_filepath != old_filepath:
os.rename(old_filepath.absolute_path, new_filepath.absolute_path) rename_map[old_filepath] = new_filepath
os.rename(old_filepath.absolute_path, new_filepath.absolute_path)
manifest_item['href'] = new_filepath.relative_to(self.opf_filepath.parent, simple=True) manifest_item['href'] = new_filepath.relative_to(self.opf_filepath.parent, simple=True)
self.fix_interlinking_opf(rename_map) self.fix_interlinking_opf(rename_map)