From 16e361baf3f9f68dd396c604c427830c93086efb Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Sun, 2 Apr 2023 13:08:06 +0200 Subject: [PATCH] convert: playlist: item_paths relative to playlist Ensure entries in items_paths are generated with a path relative to the location of the playlist file. --- beetsplug/convert.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/beetsplug/convert.py b/beetsplug/convert.py index ee9cf3641..374b68e74 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -483,12 +483,13 @@ class ConvertPlugin(BeetsPlugin): # media file paths to be unicode. Additionally we use relative # paths to ensure readability of the playlist on remote # computers. - self._log.info("Creating playlist file: {0}", - util.normpath(playlist)) + pl_normpath = util.normpath(playlist) + pl_dir = os.path.dirname(pl_normpath) + self._log.info("Creating playlist file {0}", pl_normpath) items_paths = [ - util.bytestring_path(item.destination( - basedir=dest, path_formats=path_formats, fragment=True - )) for item in items + os.path.relpath(util.bytestring_path(item.destination( + basedir=dest, path_formats=path_formats, fragment=False + )), pl_dir) for item in items ] if not pretend: m3ufile = M3UFile(playlist)