Added option to skip already downloaded tracks with different extension
This adds #21
This commit is contained in:
parent
240c133d57
commit
395ccc2e30
|
@ -392,6 +392,13 @@ class DownloadJob:
|
||||||
f.write(track.lyrics['sync'].encode('utf-8'))
|
f.write(track.lyrics['sync'].encode('utf-8'))
|
||||||
|
|
||||||
trackAlreadyDownloaded = os.path.isfile(writepath)
|
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':
|
if trackAlreadyDownloaded and self.settings['overwriteFile'] == 'b':
|
||||||
baseFilename = os.path.join(filepath, filename)
|
baseFilename = os.path.join(filepath, filename)
|
||||||
i = 1
|
i = 1
|
||||||
|
|
Loading…
Reference in New Issue