mirror of
https://github.com/beetbox/beets.git
synced 2026-02-10 17:34:05 +01:00
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.
This commit is contained in:
parent
16e25bb61b
commit
c0b1bc9867
1 changed files with 4 additions and 2 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue