diff --git a/beetsplug/smartplaylist.py b/beetsplug/smartplaylist.py index 416dc37f5..73c3f59eb 100644 --- a/beetsplug/smartplaylist.py +++ b/beetsplug/smartplaylist.py @@ -20,7 +20,7 @@ from __future__ import division, absolute_import, print_function from beets.plugins import BeetsPlugin from beets import ui -from beets.util import mkdirall, normpath, syspath, bytestring_path +from beets.util import mkdirall, normpath, sanitize_path, syspath, bytestring_path from beets.library import Item, Album, parse_query_string from beets.dbcore import OrQuery from beets.dbcore.query import MultipleSort, ParsingError @@ -186,7 +186,7 @@ class SmartPlaylistPlugin(BeetsPlugin): # As we allow tags in the m3u names, we'll need to iterate through # the items and generate the correct m3u file names. for item in items: - m3u_name = item.evaluate_template(name, True) + m3u_name = sanitize_path(item.evaluate_template(name, True), lib.replacements) if m3u_name not in m3us: m3us[m3u_name] = [] item_path = item.path