From 91527aa0126b69d1a903d04840f12d145d7be2b4 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 31 Aug 2021 02:05:43 -0700 Subject: [PATCH] Prevent double .rar extension if user already put it in basename. --- rarpar.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rarpar.py b/rarpar.py index c3318dd..189b0c9 100644 --- a/rarpar.py +++ b/rarpar.py @@ -375,6 +375,8 @@ def rarpar( date = time.strftime('%Y-%m-%d') timestamp = time.strftime('%Y-%m-%d_%H-%M-%S') + + basename = re.sub(r'\.rar$', '', basename) if not basename: basename = f'{path.basename} ({timestamp})' else: