Added option to skip already downloaded tracks with different extension

This adds #21
This commit is contained in:
RemixDev 2020-08-21 14:46:34 +02:00
parent 240c133d57
commit 395ccc2e30
1 changed files with 7 additions and 0 deletions

View File

@ -392,6 +392,13 @@ class DownloadJob:
f.write(track.lyrics['sync'].encode('utf-8'))
trackAlreadyDownloaded = os.path.isfile(writepath)
if not trackAlreadyDownloaded and self.settings['overwriteFile'] == 'e':
exts = ['.mp3', '.flac', '.opus', '.m4a']
baseFilename = os.path.join(filepath, filename)
for ext in exts:
trackAlreadyDownloaded = os.path.isfile(baseFilename+ext)
if trackAlreadyDownloaded:
break
if trackAlreadyDownloaded and self.settings['overwriteFile'] == 'b':
baseFilename = os.path.join(filepath, filename)
i = 1