discoveryplus: fix for some programs
This commit is contained in:
@@ -167,7 +167,7 @@ def seasons(item):
|
|||||||
data = session.get('{}/cms/routes/show/{}?include=default'.format(domain, item.programid)).json()['included']
|
data = session.get('{}/cms/routes/show/{}?include=default'.format(domain, item.programid)).json()['included']
|
||||||
|
|
||||||
for key in data:
|
for key in data:
|
||||||
if key['type'] == 'collection':
|
if key['type'] == 'collection' and 'filters' in key['attributes']['component']:
|
||||||
for option in key['attributes']['component']['filters'][0]['options']:
|
for option in key['attributes']['component']['filters'][0]['options']:
|
||||||
itemlist.append(item.clone(title="Stagione {}".format(option['value']),
|
itemlist.append(item.clone(title="Stagione {}".format(option['value']),
|
||||||
season=int(option['value']),
|
season=int(option['value']),
|
||||||
@@ -178,6 +178,15 @@ def seasons(item):
|
|||||||
action='episodios'))
|
action='episodios'))
|
||||||
break
|
break
|
||||||
|
|
||||||
|
if key['type'] == 'collection' and 'title' in key['attributes']:
|
||||||
|
itemlist.append(
|
||||||
|
item.clone(title=typo(key['attributes']['title'],'bold'),
|
||||||
|
plot=key['attributes'].get('description',''),
|
||||||
|
programid=key['attributes']['alias'],
|
||||||
|
id=key['id'],
|
||||||
|
action='episodios',
|
||||||
|
contentType='season'))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -190,13 +199,21 @@ def episodios(item):
|
|||||||
|
|
||||||
for key in data:
|
for key in data:
|
||||||
if key['type'] == 'video' and 'Free' in str(key.get('relationships',{}).get('contentPackages',{}).get('data',[])):
|
if key['type'] == 'video' and 'Free' in str(key.get('relationships',{}).get('contentPackages',{}).get('data',[])):
|
||||||
itemlist.append(item.clone(title = "{}x{:02d} - {}".format(item.season, key['attributes']['episodeNumber'], key['attributes']['name']),
|
if item.season:
|
||||||
|
itemlist.append(item.clone(title = "{}x{:02d} - {}".format(item.season, key['attributes']['episodeNumber'], key['attributes']['name']),
|
||||||
plot = key['attributes']['description'],
|
plot = key['attributes']['description'],
|
||||||
episode = key['attributes']['episodeNumber'],
|
episode = key['attributes']['episodeNumber'],
|
||||||
contentType = 'episode',
|
contentType = 'episode',
|
||||||
action = 'findvideos',
|
action = 'findvideos',
|
||||||
thumbnail = images[key['relationships']['images']['data'][0]['id']],
|
thumbnail = images[key['relationships']['images']['data'][0]['id']],
|
||||||
id=key['id']))
|
id=key['id']))
|
||||||
|
else:
|
||||||
|
itemlist.append(item.clone(title = key['attributes']['name'],
|
||||||
|
plot = key['attributes']['longDescription'],
|
||||||
|
contentType = 'episode',
|
||||||
|
action = 'findvideos',
|
||||||
|
thumbnail = images[key['relationships']['images']['data'][0]['id']],
|
||||||
|
id=key['id']))
|
||||||
|
|
||||||
itemlist.sort(key=lambda it: it.episode)
|
itemlist.sort(key=lambda it: it.episode)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user