Skip to content

Commit

Permalink
release: v1.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Feb 21, 2021
1 parent 9a03de8 commit a913cf4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* [v1.21.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.21.0):
* Fix seasons year

* [v1.20.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.20.0):
* Pass episodes country meta to the provider
* Use only last episodes release date for season ranges
Expand Down
24 changes: 13 additions & 11 deletions a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,20 @@ def __add_seasons(core, title):
seasons[episodeSeason] = core.utils.DictAsObject({
'episodes': 0,
'episode_ids': [],
'year': 1900,
'month': 1,
'day': 1,
'first_episode_year': episodeReleaseDate['year'],
'year': episodeReleaseDate['year'],
'month': episodeReleaseDate['month'],
'day': episodeReleaseDate['day'],
})

if index + 1 < len(episodes) and episodes[index + 1]['releaseDate']['year'] < episodeReleaseDate['year'] and (episodeSeason - 1) in seasons:
prev_season_last_ep_release_date = seasons[episodeSeason - 1].last_episode['releaseDate']
seasons[episodeSeason].update({
'year': prev_season_last_ep_release_date['year'],
'month': prev_season_last_ep_release_date['month'],
'day': prev_season_last_ep_release_date['day'] + 1,
})

seasons[episodeSeason].episodes += 1
seasons[episodeSeason].episode_ids.append(episode['id'])
seasons[episodeSeason].last_episode = episode
Expand All @@ -183,21 +192,14 @@ def __add_seasons(core, title):
'day_end': releaseDate['day'],
})

if season_to_update > 1:
prev_season_last_ep_release_date = seasons[season_to_update - 1].last_episode['releaseDate']
seasons[season_to_update].update({
'year': prev_season_last_ep_release_date['year'],
'month': prev_season_last_ep_release_date['month'],
'day': prev_season_last_ep_release_date['day'] + 1,
})
except:
pass

list_items = []
for key in seasons:
season = seasons[key]
season.key = key
season.title = __get_season_title(core, key, season.year if season.year else 'N/A', season.episodes)
season.title = __get_season_title(core, key, season.first_episode_year if season.first_episode_year else 'N/A', season.episodes)

list_item = core.kodi.xbmcgui.ListItem(label=season.title, offscreen=True)
poster = core.utils.fix_poster_size(title['primaryImage'])
Expand Down
5 changes: 4 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.a4kstreaming"
name="a4kStreaming"
version="1.20.0"
version="1.21.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -32,6 +32,9 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.21.0]:
* Fix seasons year

[v1.20.0]:
* Pass episodes country meta to the provider
* Use only last episodes release date for season ranges
Expand Down
5 changes: 4 additions & 1 deletion packages/addons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<addons>
<addon id="plugin.video.a4kstreaming"
name="a4kStreaming"
version="1.20.0"
version="1.21.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -35,6 +35,9 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.21.0]:
* Fix seasons year

[v1.20.0]:
* Pass episodes country meta to the provider
* Use only last episodes release date for season ranges
Expand Down
2 changes: 1 addition & 1 deletion packages/addons.xml.crc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12e5869b26557bcd4c600af5475fbf3f32c7d4c4
bf23c2f24482b36dba6def1963ce621e9e88c332

0 comments on commit a913cf4

Please sign in to comment.