fixed --addtofile duplicate artists (#233)

checks for '-' in the title, to avoid adding the uploader before the pre-existing artist

eg. avoid this: "uploader - artist - song"
master
Justin Mai 2017-12-12 03:08:05 -08:00 committed by Ronan
parent 0134b48f74
commit eb97629214
1 changed files with 3 additions and 2 deletions

View File

@ -390,8 +390,9 @@ def try_utime(path, filetime):
def get_filename(track, title, is_original = False):
invalid_chars = '\/:*?|<>"'
username = track['user']['username']
if username not in title and arguments['--addtofile']:
title = '{0} - {1}'.format(username, title)
if arguments['--addtofile']:
if username not in title and '-' not in title
title = '{0} - {1}'.format(username, title)
if arguments['--addtimestamp']:
# created_at sample: 2017/03/03 09:29:33 +0000