1
0
mirror of https://github.com/gryf/slack-backup.git synced 2025-12-17 11:30:25 +01:00

Fix for new fnames in case of already existing ones

This commit is contained in:
Roman Dobosz
2016-12-03 18:14:28 +01:00
parent 0d7607cf3c
commit a42506dff9

View File

@@ -79,8 +79,10 @@ class Download(object):
count = 1 count = 1
while filetype != 'avatar' and os.path.exists(path): while filetype != 'avatar' and os.path.exists(path):
base, ext = os.path.splitext(path) if count == 1:
path = base + "%0.3d" % count + ext base, ext = os.path.splitext(path)
path = base + ".%0.3d" % count + ext
count += 1
return path return path