Skip to content

Commit

Permalink
Remove never used replacements paramater from item.destination
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Dec 2, 2024
1 parent 028a9ff commit 914b119
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
5 changes: 1 addition & 4 deletions beets/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,6 @@ def destination(
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).
Expand All @@ -1081,8 +1080,6 @@ def destination(
platform = platform or sys.platform
basedir = basedir or self._db.directory
path_formats = path_formats or self._db.path_formats
if replacements is None:
replacements = self._db.replacements

# Use a path format based on a query, falling back on the
# default.
Expand Down Expand Up @@ -1127,7 +1124,7 @@ def destination(

lib_path_str, fallback = util.legalize_path(
subpath,
replacements,
self._db.replacements,
maxlen,
os.path.splitext(self.path)[1],
)
Expand Down
11 changes: 0 additions & 11 deletions test/test_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,17 +462,6 @@ def test_destination_with_replacements(self):
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"
Expand Down

0 comments on commit 914b119

Please sign in to comment.