diff --git a/beets/library.py b/beets/library.py index 2f5f31393..f45e63ebe 100644 --- a/beets/library.py +++ b/beets/library.py @@ -1079,7 +1079,6 @@ class Item(LibModel): basedir=None, platform=None, path_formats=None, - replacements=None, ) -> bytes: """Return the path in the library directory designated for the item (i.e., where the file ought to be). @@ -1091,8 +1090,6 @@ class Item(LibModel): platform = platform or sys.platform basedir = basedir or db.directory path_formats = path_formats or db.path_formats - if replacements is None: - replacements = self._db.replacements # Use a path format based on a query, falling back on the # default. @@ -1136,10 +1133,7 @@ class Item(LibModel): maxlen = util.max_filename_length(db.directory) lib_path_str, fallback = util.legalize_path( - subpath, - replacements, - maxlen, - os.path.splitext(self.path)[1], + subpath, db.replacements, maxlen, os.path.splitext(self.path)[1] ) if fallback: # Print an error message if legalization fell back to diff --git a/test/test_library.py b/test/test_library.py index d6804449f..342c2fe20 100644 --- a/test/test_library.py +++ b/test/test_library.py @@ -462,17 +462,6 @@ class DestinationTest(BeetsTestCase): self.i.album = "bar" assert self.i.destination() == np("base/ber/foo") - def test_destination_with_replacements_argument(self): - self.lib.directory = b"base" - self.lib.replacements = [(re.compile(r"a"), "f")] - self.lib.path_formats = [("default", "$album/$title")] - self.i.title = "foo" - self.i.album = "bar" - replacements = [(re.compile(r"a"), "e")] - assert self.i.destination(replacements=replacements) == np( - "base/ber/foo" - ) - @unittest.skip("unimplemented: #359") def test_destination_with_empty_component(self): self.lib.directory = b"base"