From d07d49d2e76c293d8d0276a265c5e4558b2d524c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Mon, 30 Sep 2013 18:32:43 +0200 Subject: [PATCH] Fixed slugify --- kcc/comic2ebook.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index cb0204a..4768c42 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -599,7 +599,8 @@ def sanitizeTree(filetree): else: splitname = os.path.splitext(name) slugified = slugify(splitname[0]) - while os.path.exists(os.path.join(root, slugified + splitname[1])): + while os.path.exists(os.path.join(root, slugified + splitname[1])) and splitname[0].upper()\ + != slugified.upper(): slugified += "A" os.rename(os.path.join(root, name), os.path.join(root, slugified + splitname[1])) for name in dirs: @@ -607,7 +608,7 @@ def sanitizeTree(filetree): os.remove(os.path.join(root, name)) else: slugified = slugify(name) - while os.path.exists(os.path.join(root, slugified)): + while os.path.exists(os.path.join(root, slugified)) and name.upper() != slugified.upper(): slugified += "A" os.rename(os.path.join(root, name), os.path.join(root, slugified))