mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 03:22:39 +01:00
extract config to variable
This commit is contained in:
parent
8dad7fa67f
commit
b91efb88f4
1 changed files with 4 additions and 3 deletions
|
|
@ -84,10 +84,11 @@ 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()
|
||||
sep_drive = beets.config['drive_sep_replace'].as_str()
|
||||
if re.match(r'^\w:', value):
|
||||
value = value.replace(':', sep_drive)
|
||||
|
||||
for sep in (os.path.sep, os.path.altsep):
|
||||
if sep:
|
||||
value = value.replace(sep, sep_repl)
|
||||
|
|
|
|||
Loading…
Reference in a new issue