Fix error message upon playlist deletion

This commit is contained in:
Croneter 2018-05-02 18:14:33 +02:00
parent 81b1d18192
commit 63c829b042
2 changed files with 4 additions and 14 deletions

View file

@ -869,11 +869,5 @@ def delete_playlist_from_pms(playlist):
"""
Deletes the playlist from the PMS
"""
xml = DU().downloadUrl("{server}/%ss/%s" %
(playlist.kind.lower(), playlist.id),
action_type="DELETE")
try:
xml.attrib
except (TypeError, AttributeError):
LOG.error('Could not delete playlist from server: %s', playlist)
raise PlaylistError('Could not delete playlist %s' % playlist)
DU().downloadUrl("{server}/%ss/%s" % (playlist.kind.lower(), playlist.id),
action_type="DELETE")

View file

@ -79,12 +79,8 @@ def delete_plex_playlist(playlist):
Returns None or raises PL.PlaylistError
"""
LOG.info('Deleting playlist %s from the PMS', playlist.plex_name)
try:
PL.delete_playlist_from_pms(playlist)
except PL.PlaylistError:
pass
else:
update_plex_table(playlist, delete=True)
PL.delete_playlist_from_pms(playlist)
update_plex_table(playlist, delete=True)
def create_kodi_playlist(plex_id=None, updated_at=None):