Fix KeyError for TV live channels for getGeople

This commit is contained in:
croneter 2017-09-13 15:32:44 +02:00
parent 0c20716c9b
commit 256d2c3f87

View file

@ -1346,6 +1346,7 @@ class API():
cast = [] cast = []
producer = [] producer = []
for child in self.item: for child in self.item:
try:
if child.tag == 'Director': if child.tag == 'Director':
director.append(child.attrib['tag']) director.append(child.attrib['tag'])
elif child.tag == 'Writer': elif child.tag == 'Writer':
@ -1354,6 +1355,9 @@ class API():
cast.append(child.attrib['tag']) cast.append(child.attrib['tag'])
elif child.tag == 'Producer': elif child.tag == 'Producer':
producer.append(child.attrib['tag']) producer.append(child.attrib['tag'])
except KeyError:
log.warn('Malformed PMS answer for getPeople: %s: %s'
% (child.tag, child.attrib))
return { return {
'Director': director, 'Director': director,
'Writer': writer, 'Writer': writer,