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.
This commit is contained in:
J0J0 Todos 2023-04-02 13:08:06 +02:00
parent 99231160a7
commit 16e361baf3

View file

@ -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)