From d3d52da012706433bba0726df6149c7ea95c79e2 Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Thu, 16 Jun 2016 04:08:28 -0400 Subject: [PATCH] bytestringify paths in filefilter plugin --- beetsplug/filefilter.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/beetsplug/filefilter.py b/beetsplug/filefilter.py index d3537a535..23dac5746 100644 --- a/beetsplug/filefilter.py +++ b/beetsplug/filefilter.py @@ -20,7 +20,7 @@ from __future__ import division, absolute_import, print_function import re from beets import config -from beets import util +from beets.util import bytestring_path from beets.plugins import BeetsPlugin from beets.importer import SingletonImportTask @@ -36,14 +36,15 @@ class FileFilterPlugin(BeetsPlugin): self.path_album_regex = \ self.path_singleton_regex = \ - re.compile(self.config['path'].get()) + re.compile(bytestring_path(self.config['path'].get())) if 'album_path' in self.config: - self.path_album_regex = re.compile(self.config['album_path'].get()) + self.path_album_regex = re.compile( + bytestring_path(self.config['album_path'].get())) if 'singleton_path' in self.config: self.path_singleton_regex = re.compile( - self.config['singleton_path'].get()) + bytestring_path(self.config['singleton_path'].get())) def import_task_created_event(self, session, task): if task.items and len(task.items) > 0: @@ -70,7 +71,7 @@ class FileFilterPlugin(BeetsPlugin): of the file given in full_path. """ import_config = dict(config['import']) - full_path = util.bytestring_path(full_path) + full_path = bytestring_path(full_path) if 'singletons' not in import_config or not import_config[ 'singletons']: # Album