diff --git a/beets/config_default.yaml b/beets/config_default.yaml index 0fd6eb592..c75778b80 100644 --- a/beets/config_default.yaml +++ b/beets/config_default.yaml @@ -44,6 +44,7 @@ replace: '^\s+': '' '^-': _ path_sep_replace: _ +drive_sep_replace: _ asciify_paths: false art_filename: cover max_filename_length: 0 diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index b13f2638a..abcbdd029 100755 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -19,6 +19,7 @@ from __future__ import division, absolute_import, print_function import time import os +import re from collections import defaultdict import threading import sqlite3 @@ -83,6 +84,8 @@ class FormattedMapping(Mapping): value = value.decode('utf-8', 'ignore') if self.for_path: + if re.match(r'^\w:', value): + value = value.replace(':', beets.config['drive_sep_replace'].as_str()) sep_repl = beets.config['path_sep_replace'].as_str() for sep in (os.path.sep, os.path.altsep): if sep: