Added more artists options in the name template
%artists% is now a comma separated list of artists %mainartists% is a comma and "&" separated list of artists %featartists% is like main aritsts but for featured artists
This commit is contained in:
parent
c1b5636a4f
commit
d4e571bd09
|
@ -355,17 +355,21 @@ def getTrackData(dz, trackAPI_gw, trackAPI=None, albumAPI_gw=None, albumAPI=None
|
||||||
|
|
||||||
# Create artists strings
|
# Create artists strings
|
||||||
track['mainArtistsString'] = ""
|
track['mainArtistsString'] = ""
|
||||||
|
track['commaArtistsString'] = ""
|
||||||
if 'Main' in track['artist']:
|
if 'Main' in track['artist']:
|
||||||
tot = len(track['artist']['Main'])
|
tot = len(track['artist']['Main'])
|
||||||
for i, art in enumerate(track['artist']['Main']):
|
for i, art in enumerate(track['artist']['Main']):
|
||||||
track['mainArtistsString'] += art
|
track['mainArtistsString'] += art
|
||||||
|
track['commaArtistsString'] += art
|
||||||
if tot != i + 1:
|
if tot != i + 1:
|
||||||
|
track['commaArtistsString'] += ", "
|
||||||
if tot - 1 == i + 1:
|
if tot - 1 == i + 1:
|
||||||
track['mainArtistsString'] += " & "
|
track['mainArtistsString'] += " & "
|
||||||
else:
|
else:
|
||||||
track['mainArtistsString'] += ", "
|
track['mainArtistsString'] += ", "
|
||||||
else:
|
else:
|
||||||
track['mainArtistsString'] = track['mainArtist']['name']
|
track['mainArtistsString'] = track['mainArtist']['name']
|
||||||
|
track['commaArtistsString'] = track['mainArtist']['name']
|
||||||
if 'Featured' in track['artist']:
|
if 'Featured' in track['artist']:
|
||||||
tot = len(track['artist']['Featured'])
|
tot = len(track['artist']['Featured'])
|
||||||
track['featArtistsString'] = "feat. "
|
track['featArtistsString'] = "feat. "
|
||||||
|
|
|
@ -114,7 +114,9 @@ def generateFilepath(track, trackAPI, settings):
|
||||||
def settingsRegex(filename, track, settings, playlist=None):
|
def settingsRegex(filename, track, settings, playlist=None):
|
||||||
filename = filename.replace("%title%", fixName(track['title'], settings['illegalCharacterReplacer']))
|
filename = filename.replace("%title%", fixName(track['title'], settings['illegalCharacterReplacer']))
|
||||||
filename = filename.replace("%artist%", fixName(track['mainArtist']['name'], settings['illegalCharacterReplacer']))
|
filename = filename.replace("%artist%", fixName(track['mainArtist']['name'], settings['illegalCharacterReplacer']))
|
||||||
filename = filename.replace("%artists%", fixName(track['mainArtistsString'], settings['illegalCharacterReplacer']))
|
filename = filename.replace("%artists%", fixName(track['commaArtistsString'], settings['illegalCharacterReplacer']))
|
||||||
|
filename = filename.replace("%mainartists%", fixName(track['mainArtistsString'], settings['illegalCharacterReplacer']))
|
||||||
|
filename = filename.replace("%featartists%", fixName('('+track['featArtistsString']+')', settings['illegalCharacterReplacer']) if 'featArtistsString' in track else "")
|
||||||
filename = filename.replace("%album%", fixName(track['album']['title'], settings['illegalCharacterReplacer']))
|
filename = filename.replace("%album%", fixName(track['album']['title'], settings['illegalCharacterReplacer']))
|
||||||
filename = filename.replace("%albumartist%",
|
filename = filename.replace("%albumartist%",
|
||||||
fixName(track['album']['mainArtist']['name'], settings['illegalCharacterReplacer']))
|
fixName(track['album']['mainArtist']['name'], settings['illegalCharacterReplacer']))
|
||||||
|
|
Loading…
Reference in New Issue