From 3c50bf7a5a60081694cdecde10b81e67c667a37b Mon Sep 17 00:00:00 2001 From: aj Date: Mon, 19 Aug 2019 00:52:02 +0100 Subject: [PATCH] added description overwrite and suffix support --- spotframework/engine/playlistengine.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spotframework/engine/playlistengine.py b/spotframework/engine/playlistengine.py index b6062ad..177e148 100644 --- a/spotframework/engine/playlistengine.py +++ b/spotframework/engine/playlistengine.py @@ -119,13 +119,16 @@ class PlaylistEngine: logger.error('error executing') return None - def change_description(self, playlistparts, playlist_id, suffix=None): + def change_description(self, playlistparts, playlist_id, overwrite=None, suffix=None): - if suffix: - string = ' / '.join(playlistparts) + f' - {str(suffix)}' + if overwrite: + string = overwrite else: string = ' / '.join(playlistparts) + if suffix: + string += f' - {str(suffix)}' + resp = self.net.change_playlist_details(playlist_id, description=string) if resp: return resp