Remove duplicates from track file

This commit is contained in:
ritiek
2018-06-26 10:12:23 +05:30
parent 0a3b7bd7d8
commit 40ed9b494b

View File

@@ -65,7 +65,9 @@ def check_exists(music_file, raw_song, meta_tags):
def download_list(text_file): def download_list(text_file):
""" Download all songs from the list. """ """ Download all songs from the list. """
with open(text_file, 'r') as listed: with open(text_file, 'r') as listed:
lines = (listed.read()).splitlines() # read tracks into a list and remove any duplicates
lines = listed.read().splitlines()
lines = list(set(lines))
# ignore blank lines in text_file (if any) # ignore blank lines in text_file (if any)
try: try:
lines.remove('') lines.remove('')