Simplify code

This commit is contained in:
croneter 2018-02-23 16:18:10 +01:00
parent e6631c3c78
commit c059856691

View file

@ -337,22 +337,14 @@ class API(object):
""" """
people = [] people = []
for child in self.item: for child in self.item:
if child.tag in PEOPLE_OF_INTEREST.keys(): if child.tag in PEOPLE_OF_INTEREST:
name = child.attrib['tag']
name_id = child.attrib['id']
typus = PEOPLE_OF_INTEREST[child.tag]
url = child.get('thumb')
role = child.get('role')
people.append({ people.append({
'Name': name, 'Name': child.attrib['tag'],
'Type': typus, 'Type': PEOPLE_OF_INTEREST[child.tag],
'Id': name_id, 'Id': child.attrib['id'],
'imageurl': url 'imageurl': child.get('thumb'),
'Role': child.get('role')
}) })
if url:
people[-1].update({'imageurl': url})
if role:
people[-1].update({'Role': role})
return people return people
def genre_list(self): def genre_list(self):