Prevent IndexError on unknown PMS ids
This commit is contained in:
parent
d069fc7c48
commit
4b0583b1c9
1 changed files with 5 additions and 1 deletions
|
@ -1440,10 +1440,14 @@ class LibrarySync(Thread):
|
||||||
if xml in (None, 401):
|
if xml in (None, 401):
|
||||||
log.error('Could not download data for %s, skipping' % ratingKey)
|
log.error('Could not download data for %s, skipping' % ratingKey)
|
||||||
return False, item
|
return False, item
|
||||||
|
try:
|
||||||
|
mediatype = xml[0].attrib['type']
|
||||||
|
except (IndexError, KeyError):
|
||||||
|
log.error('Could not download metadata for %s' % ratingKey)
|
||||||
|
return False, item
|
||||||
log.debug("Processing new/updated PMS item: %s" % ratingKey)
|
log.debug("Processing new/updated PMS item: %s" % ratingKey)
|
||||||
viewtag = xml.attrib.get('librarySectionTitle')
|
viewtag = xml.attrib.get('librarySectionTitle')
|
||||||
viewid = xml.attrib.get('librarySectionID')
|
viewid = xml.attrib.get('librarySectionID')
|
||||||
mediatype = xml[0].attrib.get('type')
|
|
||||||
# Attach mediatype for later
|
# Attach mediatype for later
|
||||||
item['mediatype'] = mediatype
|
item['mediatype'] = mediatype
|
||||||
if mediatype == 'movie':
|
if mediatype == 'movie':
|
||||||
|
|
Loading…
Reference in a new issue