From 3ae1b97d72ff4d74f07e156d8e4026f12808a509 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 30 Jan 2022 13:44:53 +0100 Subject: [PATCH] Fix renaming title and author in the same request --- cps/helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cps/helper.py b/cps/helper.py index 2daf8494..f6ea024f 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -398,6 +398,8 @@ def update_dir_structure_file(book_id, calibrepath, first_author, orignal_filepa log.debug(ex, exc_info=True) return _("Rename author from: '%(src)s' to '%(dest)s' failed with error: %(error)s", src=old_author_path, dest=new_author_path, error=str(ex)) + if first_author.lower() in [r.lower() for r in renamed_author]: + path = os.path.join(calibrepath, new_authordir, titledir) else: new_authordir = get_valid_filename(localbook.authors[0].name) new_titledir = get_valid_filename(localbook.title) + " (" + str(book_id) + ")"