From 3f6f557dc35b68fb329072b12839e6c2c8eb399b Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 3 Aug 2018 20:45:10 +0200 Subject: [PATCH] Fix casting to PKC failing --- resources/lib/playlist_func.py | 2 +- resources/lib/plex_companion.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/lib/playlist_func.py b/resources/lib/playlist_func.py index 98900242..cd1999f7 100644 --- a/resources/lib/playlist_func.py +++ b/resources/lib/playlist_func.py @@ -652,7 +652,7 @@ def get_PMS_playlist(playlist, playlist_id=None): if playlist.kind == 'playList': xml = DU().downloadUrl("{server}/playlists/%s/items" % playlist_id) else: - xml = DU().downloadUrl("{server}/playqueues/%s" % playlist_id) + xml = DU().downloadUrl("{server}/playQueues/%s" % playlist_id) try: xml.attrib except AttributeError: diff --git a/resources/lib/plex_companion.py b/resources/lib/plex_companion.py index 6e686443..3f97b704 100644 --- a/resources/lib/plex_companion.py +++ b/resources/lib/plex_companion.py @@ -48,6 +48,11 @@ def update_playqueue_from_PMS(playqueue, transient_token = playqueue.plex_transient_token with state.LOCK_PLAYQUEUES: xml = PL.get_PMS_playlist(playqueue, playqueue_id) + try: + xml.attrib + except AttributeError: + LOG.error('Could now download playqueue %s', playqueue_id) + return playqueue.clear() try: PL.get_playlist_details_from_xml(playqueue, xml)