forked from LBRYCommunity/lbry-sdk
fix file name for files that already exist
This commit is contained in:
parent
e40d4f74d8
commit
a7567361dc
1 changed files with 1 additions and 3 deletions
|
@ -17,9 +17,7 @@ log = logging.getLogger(__name__)
|
|||
|
||||
|
||||
def _get_next_available_file_name(download_directory, file_name):
|
||||
base_name, ext = os.path.splitext(file_name or "_")
|
||||
if ext:
|
||||
ext = ".%s" % ext
|
||||
base_name, ext = os.path.splitext(file_name)
|
||||
i = 0
|
||||
while os.path.isfile(os.path.join(download_directory, file_name)):
|
||||
i += 1
|
||||
|
|
Loading…
Add table
Reference in a new issue