From e9a1a2383c8bd5841db3e9707bb1d04e86ed1c1c Mon Sep 17 00:00:00 2001 From: Chris Hylen Date: Thu, 3 Mar 2022 06:52:43 -0600 Subject: [PATCH] fix #245 part 2 removal of common path between playlist and files, already documented as intended behavior. remove deprecated string_ --- plugins/playlist/playlist.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/playlist/playlist.py b/plugins/playlist/playlist.py index df77059f..4f69245a 100644 --- a/plugins/playlist/playlist.py +++ b/plugins/playlist/playlist.py @@ -16,7 +16,7 @@ PLUGIN_DESCRIPTION = """Generate an Extended M3U playlist (.m3u8 file, UTF8 encoded text). Relative pathnames are used where audio files are in the same directory as the playlist, otherwise absolute (full) pathnames are used.""" -PLUGIN_VERSION = "1.1.1" +PLUGIN_VERSION = "1.2" PLUGIN_API_VERSIONS = ["2.0"] PLUGIN_LICENSE = "GPL-2.0-or-later" PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html" @@ -133,8 +133,8 @@ def callback(self, objs): if _debug_level > 1: log.debug("{}: audio_filename: {}, selected dir: {}".format( PLUGIN_NAME, audio_filename, os.path.dirname(filename))) - if os.path.dirname(filename) == os.path.dirname(audio_filename): - audio_filename = os.path.basename(audio_filename) + + audio_filename = os.path.relpath(audio_filename, os.path.dirname(filename)) entry.add(str(audio_filename)) playlist.write()