include check for whether or not the title template returns anything

in the case of returning nothing, script would delete every playlist
Resolves #303
This commit is contained in:
blacktwin 2021-08-17 08:00:45 -04:00
parent a479596b35
commit c84cee5fec

View File

@ -628,7 +628,7 @@ def delete_playlist(playlist_dict, title, jbop=None):
# catching for history* jbops
titleTemplate = selectors().get(jbop)
titleStart = titleTemplate.split('{')[0]
if playlist.title.startswith(titleStart):
if titleStart and playlist.title.startswith(titleStart):
playlist.delete()
logger.info("...Deleted Playlist: {playlist.title} for '{user}'."
.format(playlist=playlist, user=user))