Abort if no xml received from PMS
This commit is contained in:
parent
6df9bcd6b7
commit
dd40192a51
2 changed files with 7 additions and 3 deletions
|
@ -38,6 +38,11 @@ class Playback_Starter(Thread):
|
||||||
# Todo: Warn user with dialog
|
# Todo: Warn user with dialog
|
||||||
return
|
return
|
||||||
xml = GetPlexMetadata(plex_id)
|
xml = GetPlexMetadata(plex_id)
|
||||||
|
try:
|
||||||
|
xml[0].attrib
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
log.error('Could not get a PMS xml for plex id %s' % plex_id)
|
||||||
|
return
|
||||||
if xml[0].attrib.get('type') == PLEX_TYPE_PHOTO:
|
if xml[0].attrib.get('type') == PLEX_TYPE_PHOTO:
|
||||||
# Photo
|
# Photo
|
||||||
result = Playback_Successful()
|
result = Playback_Successful()
|
||||||
|
|
|
@ -34,9 +34,8 @@ addonName = "PlexKodiConnect"
|
||||||
|
|
||||||
class PlaybackUtils():
|
class PlaybackUtils():
|
||||||
|
|
||||||
def __init__(self, item, callback=None, playlist_type=None):
|
def __init__(self, xml, callback=None, playlist_type=None):
|
||||||
self.item = item
|
self.xml = xml
|
||||||
self.api = API(item)
|
|
||||||
playlist_type = playlist_type if playlist_type else \
|
playlist_type = playlist_type if playlist_type else \
|
||||||
KODI_PLAYLIST_TYPE_FROM_PLEX_TYPE[self.api.getType()]
|
KODI_PLAYLIST_TYPE_FROM_PLEX_TYPE[self.api.getType()]
|
||||||
if callback:
|
if callback:
|
||||||
|
|
Loading…
Reference in a new issue