+ # XXX all this quoting is an unholy mess and I can see bugs:
+ # Escaping quotes and then assembling a file name out of that?!
+ # Moved this part up 2018-11-03 and followed Microsoft file name rules.
+ outfile_album = album
+ if discnum != None:
+ outfile_album = '%s (disc %s)' % (album, discnum)
+ quoted_outfile = ('%s (%s) %02d %s.mp3' % (
+ artist, outfile_album, track, title)) \
+ .replace("'", '_') \
+ .replace('<', '_') \
+ .replace('>', '_') \
+ .replace(':', '_') \
+ .replace('"', '_') \
+ .replace('/', '_') \
+ .replace('\\', '_') \
+ .replace('|', '_') \
+ .replace('?', '_') \
+ .replace('*', '_')
+