From c0b1bc986705d75a36a90da4f7999b39fcf420c0 Mon Sep 17 00:00:00 2001 From: J0J0 T Date: Wed, 6 Jul 2022 08:36:32 +0200 Subject: [PATCH] convert: playlist feature: Better relative path gen Use Item.destination method for generation of relative paths to media files in playlist. The fragment keyword enables returning the path as unicode instead of bytes, let's keep that in mind. --- beetsplug/convert.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/beetsplug/convert.py b/beetsplug/convert.py index 082124b8c..5d6f2ce07 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -304,8 +304,10 @@ class ConvertPlugin(BeetsPlugin): # media file paths to be unicode. Additionally we use relative # paths to ensure readability of the playlist on remote # computers. - dest_relative = util.displayable_path(dest).replace( - util.displayable_path(dest_dir) + os.sep, "" + dest_relative = item.destination( + basedir=dest_dir, + path_formats=path_formats, + fragment=True ) with open(playlist, "a") as playlist_file: playlist_file.write(dest_relative + "\n")