Skip to content

Commit

Permalink
release: v1.57.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Jan 6, 2024
1 parent 3ac201c commit 21a222c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* [v1.57.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.57.0):
* New context menu:
* IMDB: Choose Trailer - allows to choose a trailer video from the list of available ones

* [v1.56.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.56.0):
* Remember last selected result until the list changes
* Increase cache size
Expand Down
21 changes: 20 additions & 1 deletion a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,17 @@ def __set_title_contextmenu(core, title, list_item):
return

trailer = ''
all_trailers = ''
if title.get('primaryVideos', None) and len(title['primaryVideos']) > 0:
trailer = title['primaryVideos'][0]
all_trailers = '_'.join(title['primaryVideos'])

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(%s?action=profile&type=rate&id=%s)' % (core.url, title['id'])),
('IMDb: Trailer', 'RunPlugin(%s?action=trailer&id=%s&vi=%s&play=true)' % (core.url, title['id'], trailer)),
('IMDb: Choose Trailer', 'RunPlugin(%s?action=trailer&id=%s&vi=%s&play=true)' % (core.url, title['id'], all_trailers)),
('IMDb: Cast & Crew', 'ActivateWindow(Videos,%s?action=query&type=browse&id=%s,return)' % (core.url, title['id'])),
]

Expand Down Expand Up @@ -1992,9 +1995,25 @@ def trailer(core, params):
core.kodi.notification('Trailer not found')
return

videos = params.vi.split('_')
vi = videos[0]

if len(videos) > 1:
selection = core.kodi.xbmcgui.Dialog().select(
'Choose trailer',
['%s. %s' % (i + 1, v) for i, v in enumerate(videos)],
)

if selection == -1:
core.kodi.close_busy_dialog()
core.utils.end_action(core, False)
return

vi = videos[selection]

request = {
'method': 'GET',
'url': 'https://www.imdb.com/_next/data/%s/video/%s.json' % (__build_id, params.vi),
'url': 'https://www.imdb.com/_next/data/%s/video/%s.json' % (__build_id, vi),
'params': {
'playlistId': params.id,
'viconst': params.vi,
Expand Down
2 changes: 1 addition & 1 deletion a4kStreaming/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def get_graphql_query(body):
text
}
}
primaryVideos(first: 1) {
primaryVideos(first: 100) {
edges {
node {
id
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.56.0"
version="1.57.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.57.0]:
* New context menu:
* IMDB: Choose Trailer - allows to choose a trailer video from the list of available ones

[v1.56.0]:
* Remember last selected result until the list changes
* Increase cache size
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.56.0"
version="1.57.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.57.0]:
* New context menu:
* IMDB: Choose Trailer - allows to choose a trailer video from the list of available ones

[v1.56.0]:
* Remember last selected result until the list changes
* Increase cache size
Expand Down
2 changes: 1 addition & 1 deletion packages/addons.xml.crc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f2ce6a29d3754634f6f222ca84c0f73d2320033c
76d587191f27f01d12004970f343918989b0fd5a

0 comments on commit 21a222c

Please sign in to comment.