Skip to content

Commit bc3cca2

Browse files
committed
smartplaylist: Use .get(bool) for all boolean configs
which enhances code readability for future readers.
1 parent 59a1393 commit bc3cca2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

beetsplug/smartplaylist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def update_playlists(self, lib: Library, pretend: bool = False) -> None:
278278
)
279279
tpl = self.config["uri_format"].get()
280280
prefix = bytestring_path(self.config["prefix"].as_str())
281-
dest_regen = self.config["dest_regen"].get()
281+
dest_regen = self.config["dest_regen"].get(bool)
282282
relative_to = self.config["relative_to"].get()
283283
if relative_to:
284284
relative_to = normpath(relative_to)
@@ -334,9 +334,9 @@ def update_playlists(self, lib: Library, pretend: bool = False) -> None:
334334
item_uri = item.destination()
335335
if relative_to:
336336
item_uri = os.path.relpath(item_uri, relative_to)
337-
if self.config["forward_slash"].get():
337+
if self.config["forward_slash"].get(bool):
338338
item_uri = path_as_posix(item_uri)
339-
if self.config["urlencode"]:
339+
if self.config["urlencode"].get(bool):
340340
item_uri = bytestring_path(
341341
pathname2url(os.fsdecode(item_uri))
342342
)

0 commit comments

Comments
 (0)