Skip to content

Commit

Permalink
release: v1.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Mar 30, 2021
1 parent 4608061 commit bac3c4a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* [v1.24.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.24.0):
* Improve Actor/Actress/Director titles browsing

* [v1.23.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.23.0):
* Fix force select context menu

Expand Down
34 changes: 30 additions & 4 deletions a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,9 @@ def query(core, params):
}),
'knownfor': lambda: core.utils.get_graphql_query({
'query': '''
query fn($id: ID!, $limit: Int!, $EXTRA_PARAMS) {
query fn($id: ID!, $limit: Int!, $paginationToken: ID, $EXTRA_PARAMS) {
name(id: $id) {
credits(first: $limit) {
credits(first: $limit, after: $paginationToken, filter: { categories: ["actor", "actress", "director", "writer"], credited: CREDITED_ONLY }) {
titles: edges {
node {
title {
Expand All @@ -1296,6 +1296,7 @@ def query(core, params):
'variables': {
'id': params.id,
'limit': page_size,
'paginationToken': params.paginationToken,
}
}),
'browse': lambda: core.utils.get_graphql_query({
Expand Down Expand Up @@ -1558,7 +1559,7 @@ def query(core, params):
return []
else:
if 'data' not in parsed_response:
if not params.retry and len(errors) > 0 and 'The channel was closed before the send operation began' in errors[0]['message']:
if not params.retry and len(errors) > 0:
params.retry = True
return query(core, params)
else:
Expand Down Expand Up @@ -1625,7 +1626,32 @@ def query(core, params):
return result
else:
core.contentType = 'movies'
__add_titles(core, data if isinstance(data, list) else data.get('titles', []), browse=None)
titles = data if isinstance(data, list) else data.get('titles', [])
if params.type == 'knownfor':
title_ids = {}
temp_titles = []
for title in titles:
if title_ids.get(title['id'], True):
title_ids[title['id']] = False
temp_titles.append(title)

titles = list(filter(lambda t: t['titleType'] != 'tvEpisode' and t.get('primaryImage', None) and title, temp_titles))
pageInfo = data.get('pageInfo', {})
hasNextPage = pageInfo.get('hasNextPage', None)
paginationToken = pageInfo.get('endCursor', None)

if hasNextPage:
params_copy = core.utils.DictAsObject(params.copy())
params_copy.paginationToken = paginationToken
nextTitles = query(core, params_copy)
titles = titles + nextTitles

if params.paginationToken:
return titles

data['pageInfo'] = None

__add_titles(core, titles, browse=None)

if isinstance(data, dict) and (data.get('paginationToken', None) or data.get('pageInfo', None) and data['pageInfo'].get('hasNextPage', False)):
next_list_item = core.kodi.xbmcgui.ListItem(label='Next', offscreen=True)
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.23.0"
version="1.24.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.24.0]:
* Improve Actor/Actress/Director titles browsing

[v1.23.0]:
* Fix force select context menu

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.23.0"
version="1.24.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.24.0]:
* Improve Actor/Actress/Director titles browsing

[v1.23.0]:
* Fix force select context menu

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

0 comments on commit bac3c4a

Please sign in to comment.