Skip to content

Commit

Permalink
release: v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Jan 13, 2021
1 parent 8a4e5c5 commit 295c40b
Show file tree
Hide file tree
Showing 7 changed files with 58 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 @@
* [v0.5.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-0.5.0):
* New context menu:
* More like this - Showing similar titles
* [v0.4.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-0.4.0):
* Update description
* [v0.3.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-0.3.0):
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Designed for low-end devices and Estuary skin.
* Artwork for posters, thumbnails and fanart
* Trailers
* Rate/Unrate titles
* Seeing similar titles (i.e. More like this)
* Provider support
* Install
* Manage
Expand Down
42 changes: 38 additions & 4 deletions a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,22 @@ def __set_wide_image_as_primary(title):
if len(wide_images) > 0:
title['primaryImage'] = wide_images[0]

def __set_titles_contextmenu(title, list_item):
tvseries = title['titleType'] == 'tvSeries'
def __set_title_contextmenu(core, title, list_item):
titleType = title['titleType']
if titleType == 'person':
return

tvseries = titleType == 'tvSeries'
has_rating = title.get('userRating', None) is not None
context_menu_items = [
('IMDb: %s rating' % ('Update' if has_rating else 'Set'), 'RunPlugin(plugin://plugin.video.a4kstreaming/?action=profile&type=rate&id=%s)' % title['id'])
('IMDb: %s rating' % ('Update' if has_rating else 'Set'), 'RunPlugin(plugin://plugin.video.a4kstreaming/?action=profile&type=rate&id=%s)' % title['id']),
]

if titleType != 'tvEpisode':
context_menu_items.append(
('IMDb: More like this', 'XBMC.Container.Update(%s?action=query&type=more_like_this&id=%s)' % (core.url, title['id']))
)

if not tvseries:
if has_rating:
list_item.setInfo('video', {
Expand Down Expand Up @@ -479,7 +488,7 @@ def __add_titles(core, titles, browse):
url += '&id=%s' % title['id']

list_item.setContentLookup(False)
__set_titles_contextmenu(title, list_item)
__set_title_contextmenu(core, title, list_item)
list_items.append((url, list_item, action != 'play'))

core.kodi.xbmcplugin.addDirectoryItems(core.handle, list_items, len(list_items))
Expand Down Expand Up @@ -756,6 +765,31 @@ def query(core, params):
'first': 100,
}
}),
'more_like_this': lambda: core.utils.get_graphql_query({
'query': '''
query fn($id: ID!, $paginationToken: ID, $first: Int!, $EXTRA_PARAMS) {
title(id: $id) {
moreLikeThisTitles(first: $first, after: $paginationToken) {
titles: edges {
node {
...Title
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
''',
'operationName': 'fn',
'variables': {
'id': params.id,
'paginationToken': params.paginationToken,
'first': page_size,
}
}),
'seasons': lambda: core.utils.get_graphql_query({
'query': '''
query fn($id: ID!, $paginationToken: ID, $EXTRA_PARAMS) {
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="0.4.0"
version="0.5.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>
[v0.5.0]:
* New context menu:
* More like this - Showing similar titles
[v0.4.0]:
* Update description
[v0.3.0]:
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="0.4.0"
version="0.5.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>
[v0.5.0]:
* New context menu:
* More like this - Showing similar titles
[v0.4.0]:
* Update description
[v0.3.0]:
Expand Down
2 changes: 1 addition & 1 deletion packages/addons.xml.crc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
38393e752c095625ee6196e89d9a2f9cc71ccedd
3bcb55b6d41c0d671696a5402addc4b4dbd2ef12
7 changes: 7 additions & 0 deletions tests/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ def test_top_picks():

assert len(fn.results) > 0

def test_more_like_this():
a4kstreaming_api = api.A4kStreamingApi({'kodi': True})

fn = __invoke(a4kstreaming_api, 'query', { 'type': 'more_like_this', 'id': 'tt0383574' })

assert len(fn.results) > 0

def test_watchlist():
a4kstreaming_api = api.A4kStreamingApi({'kodi': True})

Expand Down

0 comments on commit 295c40b

Please sign in to comment.