mirror of
https://github.com/beetbox/beets.git
synced 2025-12-21 16:13:38 +01:00
Remove never used replacements paramater from item.destination
This commit is contained in:
parent
52951bf719
commit
06dd2738bb
2 changed files with 1 additions and 18 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue