Prevent double .rar extension if user already put it in basename.

This commit is contained in:
voussoir 2021-08-31 02:05:43 -07:00
parent 88e127c7b1
commit 91527aa012
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -375,6 +375,8 @@ def rarpar(
date = time.strftime('%Y-%m-%d') date = time.strftime('%Y-%m-%d')
timestamp = time.strftime('%Y-%m-%d_%H-%M-%S') timestamp = time.strftime('%Y-%m-%d_%H-%M-%S')
basename = re.sub(r'\.rar$', '', basename)
if not basename: if not basename:
basename = f'{path.basename} ({timestamp})' basename = f'{path.basename} ({timestamp})'
else: else: