fixed path standard in windows
This commit is contained in:
parent
b49b844cc0
commit
03a3e29097
|
@ -123,7 +123,7 @@ def settingsRegex(filename, track, settings, playlist=None):
|
||||||
filename = filename.replace("%position%", pad(track['position'], playlist['nb_tracks'], settings['padTracks']))
|
filename = filename.replace("%position%", pad(track['position'], playlist['nb_tracks'], settings['padTracks']))
|
||||||
else:
|
else:
|
||||||
filename = filename.replace("%position%", pad(track['trackNumber'], track['album']['trackTotal'], settings['padTracks']))
|
filename = filename.replace("%position%", pad(track['trackNumber'], track['album']['trackTotal'], settings['padTracks']))
|
||||||
filename = re.sub(r'[/\\]', pathSep, filename)
|
filename = filename.replace('\\', pathSep).replace('/', pathSep)
|
||||||
return antiDot(fixLongName(filename))
|
return antiDot(fixLongName(filename))
|
||||||
|
|
||||||
def settingsRegexAlbum(foldername, album, settings):
|
def settingsRegexAlbum(foldername, album, settings):
|
||||||
|
@ -144,13 +144,13 @@ def settingsRegexAlbum(foldername, album, settings):
|
||||||
foldername = foldername.replace("%date%", "{}-{}-{}".format(str(album['date']['year']), str(album['date']['month']), str(album['date']['day'])))
|
foldername = foldername.replace("%date%", "{}-{}-{}".format(str(album['date']['year']), str(album['date']['month']), str(album['date']['day'])))
|
||||||
foldername = foldername.replace("%bitrate%", bitrateLabels[int(album['bitrate'])])
|
foldername = foldername.replace("%bitrate%", bitrateLabels[int(album['bitrate'])])
|
||||||
|
|
||||||
foldername = re.sub(r'[/\\]', pathSep, foldername)
|
foldername = foldername.replace('\\', pathSep).replace('/', pathSep)
|
||||||
return antiDot(fixLongName(foldername))
|
return antiDot(fixLongName(foldername))
|
||||||
|
|
||||||
def settingsRegexArtist(foldername, artist, settings):
|
def settingsRegexArtist(foldername, artist, settings):
|
||||||
foldername = foldername.replace("%artist%", fixName(artist['name'], settings['illegalCharacterReplacer']))
|
foldername = foldername.replace("%artist%", fixName(artist['name'], settings['illegalCharacterReplacer']))
|
||||||
foldername = foldername.replace("%artist_id%", str(artist['id']))
|
foldername = foldername.replace("%artist_id%", str(artist['id']))
|
||||||
foldername = re.sub(r'[/\\]', pathSep, foldername)
|
foldername = foldername.replace('\\', pathSep).replace('/', pathSep)
|
||||||
return antiDot(fixLongName(foldername))
|
return antiDot(fixLongName(foldername))
|
||||||
|
|
||||||
def settingsRegexPlaylist(foldername, playlist, settings):
|
def settingsRegexPlaylist(foldername, playlist, settings):
|
||||||
|
@ -160,5 +160,5 @@ def settingsRegexPlaylist(foldername, playlist, settings):
|
||||||
foldername = foldername.replace("%owner_id%", str(playlist['creator']['id']))
|
foldername = foldername.replace("%owner_id%", str(playlist['creator']['id']))
|
||||||
foldername = foldername.replace("%year%", str(playlist['creation_date'][:4]))
|
foldername = foldername.replace("%year%", str(playlist['creation_date'][:4]))
|
||||||
foldername = foldername.replace("%date%", str(playlist['creation_date'][:10]))
|
foldername = foldername.replace("%date%", str(playlist['creation_date'][:10]))
|
||||||
foldername = re.sub(r'[/\\]', pathSep, foldername)
|
foldername = foldername.replace('\\', pathSep).replace('/', pathSep)
|
||||||
return antiDot(fixLongName(foldername))
|
return antiDot(fixLongName(foldername))
|
||||||
|
|
Loading…
Reference in New Issue