Simplify code
This commit is contained in:
parent
e6631c3c78
commit
c059856691
1 changed files with 6 additions and 14 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue