Don't add unchanged paths to the rename_map.
This commit is contained in:
parent
87f1de1dc5
commit
34ce1bac56
1 changed files with 3 additions and 2 deletions
|
@ -877,6 +877,7 @@ 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)
|
||||||
|
if new_filepath != old_filepath:
|
||||||
rename_map[old_filepath] = new_filepath
|
rename_map[old_filepath] = new_filepath
|
||||||
os.rename(old_filepath.absolute_path, new_filepath.absolute_path)
|
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)
|
||||||
|
|
Loading…
Reference in a new issue