summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ0J0 Todos <jojo@peek-a-boo.at>2023-04-02 13:08:06 +0200
committerJ0J0 Todos <jojo@peek-a-boo.at>2023-04-02 13:10:14 +0200
commit16e361baf3f9f68dd396c604c427830c93086efb (patch)
treefe2c118c951f0cb01272e60b2d2e312126a8f4fd
parent99231160a76bca161b14abbd10a32716436fcfbe (diff)
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.
-rw-r--r--beetsplug/convert.py11
1 files 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)