Skip to content

Commit

Permalink
0.2.30~beta11 [CA - TVA] Fix for Catch-up TV of Star Academie
Browse files Browse the repository at this point in the history
  • Loading branch information
wwark committed Feb 16, 2021
1 parent 16b4d5a commit 7044cf9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
3 changes: 2 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.catchuptvandmore" name="Catch-up TV &amp; More" version="0.2.30~beta10" provider-name="SylvainCecchetto,wwark">
<addon id="plugin.video.catchuptvandmore" name="Catch-up TV &amp; More" version="0.2.30~beta11" provider-name="SylvainCecchetto,wwark">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.codequick" version="0.9.13"/>
Expand Down Expand Up @@ -67,6 +67,7 @@
[UK - STV] Fix Catch-up TV
[UK - Blaze TV] Fix Catch-up TV
[CA - TeleQuebec] Readd Live TV
[CA - TVA] Fix for Catch-up TV of Star Academie
----
Visit WebSite - http://mpdb.tv/#home which host the french forum used by users of CU TV and More
</news>
Expand Down
29 changes: 26 additions & 3 deletions resources/lib/channels/ca/tva.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,15 @@ def list_seasons(plugin, item_id, program_slug, **kwargs):
list_videos_categories, item_id=item_id, program_slug=program_slug, season_number=season_number)
item_post_treatment(item)
yield item
else:
season_name = json_parser['name']
season_number = '-1'
item = Listitem()
item.label = season_name
item.set_callback(
list_videos_categories, item_id=item_id, program_slug=program_slug, season_number=season_number)
item_post_treatment(item)
yield item


@Route.register
Expand All @@ -184,9 +193,9 @@ def list_videos_categories(plugin, item_id, program_slug, season_number, **kwarg
resp = urlquick.get(URL_API + '/entities?slug=%s' % program_slug)
json_parser = json.loads(resp.text)

for season_datas in json_parser['knownEntities']['seasons']['associatedEntities']:
if season_number == str(season_datas['seasonNumber']):
for video_category_datas in season_datas['associatedEntities']:
if season_number == '-1':
for video_category_datas in json_parser['associatedEntities']:
if 'associatedEntities' in video_category_datas:
if len(video_category_datas['associatedEntities']) > 0:
video_category_name = video_category_datas['name']
video_category_slug = video_category_datas['slug']
Expand All @@ -197,6 +206,20 @@ def list_videos_categories(plugin, item_id, program_slug, season_number, **kwarg
list_videos, item_id=item_id, video_category_slug=video_category_slug)
item_post_treatment(item)
yield item
else:
for season_datas in json_parser['knownEntities']['seasons']['associatedEntities']:
if season_number == str(season_datas['seasonNumber']):
for video_category_datas in season_datas['associatedEntities']:
if len(video_category_datas['associatedEntities']) > 0:
video_category_name = video_category_datas['name']
video_category_slug = video_category_datas['slug']

item = Listitem()
item.label = video_category_name
item.set_callback(
list_videos, item_id=item_id, video_category_slug=video_category_slug)
item_post_treatment(item)
yield item


@Route.register
Expand Down

0 comments on commit 7044cf9

Please sign in to comment.