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:
parent
a479596b35
commit
c84cee5fec
@ -628,7 +628,7 @@ def delete_playlist(playlist_dict, title, jbop=None):
|
|||||||
# catching for history* jbops
|
# catching for history* jbops
|
||||||
titleTemplate = selectors().get(jbop)
|
titleTemplate = selectors().get(jbop)
|
||||||
titleStart = titleTemplate.split('{')[0]
|
titleStart = titleTemplate.split('{')[0]
|
||||||
if playlist.title.startswith(titleStart):
|
if titleStart and playlist.title.startswith(titleStart):
|
||||||
playlist.delete()
|
playlist.delete()
|
||||||
logger.info("...Deleted Playlist: {playlist.title} for '{user}'."
|
logger.info("...Deleted Playlist: {playlist.title} for '{user}'."
|
||||||
.format(playlist=playlist, user=user))
|
.format(playlist=playlist, user=user))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user