Skip to content

Commit

Permalink
release: v1.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Feb 21, 2021
1 parent 9ed3616 commit 9a03de8
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* [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

* [v1.19.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.19.0):
* Fix PM browsing in KODI 18 - redefining variable from scope

Expand Down
32 changes: 24 additions & 8 deletions a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,32 +156,40 @@ def __add_seasons(core, title):
seasons[episodeSeason] = core.utils.DictAsObject({
'episodes': 0,
'episode_ids': [],
'year': episodeReleaseDate['year'],
'month': episodeReleaseDate['month'],
'day': episodeReleaseDate['day'],
'year': 1900,
'month': 1,
'day': 1,
})

seasons[episodeSeason].episodes += 1
seasons[episodeSeason].episode_ids.append(episode['id'])
seasons[episodeSeason].last_episode = episode

if index > 0:
seasonToUpdate = None
season_to_update = None
releaseDate = None
if episodes[index - 1]['series']['seasonNumber'] + 1 == episodeSeason:
seasonToUpdate = episodeSeason - 1
season_to_update = episodeSeason - 1
releaseDate = episodes[index - 1]['releaseDate']

if index + 1 == len(episodes):
seasonToUpdate = episodeSeason
season_to_update = episodeSeason
releaseDate = episodeReleaseDate

if seasonToUpdate:
seasons[seasonToUpdate].update({
if season_to_update:
seasons[season_to_update].update({
'year_end': releaseDate['year'],
'month_end': releaseDate['month'],
'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

Expand Down Expand Up @@ -323,6 +331,8 @@ def __add_title(core, title, silent=False):
title['seasons'] = series['seasons']
if series.get('nextEpisodeSeasonNumber', None):
title['nextEpisodeSeasonNumber'] = next(iter(series['nextEpisodeSeasonNumber']), -1)
if not title.get('countriesOfOrigin', None) and series.get('countriesOfOrigin', None):
title['countriesOfOrigin'] = series['countriesOfOrigin']

if not title.get('poster', None) and title.get('seriesPoster', None):
title['poster'] = title['seriesPoster']
Expand Down Expand Up @@ -2399,6 +2409,12 @@ def delete_magnet():
' %sX%s ' % (season, episode_zfill_3),
' %s%s ' % (result['ref'].season, episode_zfill),
' %s%s ' % (result['ref'].season, episode_zfill_3),
' %s%s ' % (season_zfill, episode_zfill),
' %s%s ' % (season_zfill, episode_zfill_3),
' %s %s ' % (result['ref'].season, episode_zfill),
' %s %s ' % (result['ref'].season, episode_zfill_3),
' %s %s ' % (season_zfill, episode_zfill),
' %s %s ' % (season_zfill, episode_zfill_3),
]
episodes = list(filter(lambda file: any(match in core.utils.clean_release_title(file['path']) for match in matches), files))
if len(episodes) > 0:
Expand Down
5 changes: 5 additions & 0 deletions a4kStreaming/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,11 @@ def get_graphql_query(body):
number
}
}
countriesOfOrigin {
countries(limit: $countriesLimit) {
text
}
}
nextEpisodeSeasonNumber: episodes {
episodes(first: 1, filter: { releasedOnOrAfter: { day: %s, month: %s, year: %s } }) {
edges {
Expand Down
6 changes: 5 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.19.0"
version="1.20.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -32,6 +32,10 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.20.0]:
* Pass episodes country meta to the provider
* Use only last episodes release date for season ranges

[v1.19.0]:
* Fix PM browsing in KODI 18 - redefining variable from scope

Expand Down
6 changes: 5 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.19.0"
version="1.20.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -35,6 +35,10 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.20.0]:
* Pass episodes country meta to the provider
* Use only last episodes release date for season ranges

[v1.19.0]:
* Fix PM browsing in KODI 18 - redefining variable from scope

Expand Down
2 changes: 1 addition & 1 deletion packages/addons.xml.crc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cd1c304f982531eba245be6140dc4f45f66c3a08
12e5869b26557bcd4c600af5475fbf3f32c7d4c4

0 comments on commit 9a03de8

Please sign in to comment.