From 21a222c925101c06b29d1b3834c1301b0b00510a Mon Sep 17 00:00:00 2001 From: newt-sc <47229722+newt-sc@users.noreply.github.com> Date: Sat, 6 Jan 2024 18:02:15 +0200 Subject: [PATCH] release: v1.57.0 --- CHANGELOG.md | 4 ++++ a4kStreaming/explorer.py | 21 ++++++++++++++++++++- a4kStreaming/lib/utils.py | 2 +- addon.xml | 6 +++++- packages/addons.xml | 6 +++++- packages/addons.xml.crc | 2 +- 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4317b3d..d5d0b94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/a4kStreaming/explorer.py b/a4kStreaming/explorer.py index 8a0a57c..0b85ca4 100644 --- a/a4kStreaming/explorer.py +++ b/a4kStreaming/explorer.py @@ -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'])), ] @@ -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, diff --git a/a4kStreaming/lib/utils.py b/a4kStreaming/lib/utils.py index f38d314..faa3902 100644 --- a/a4kStreaming/lib/utils.py +++ b/a4kStreaming/lib/utils.py @@ -498,7 +498,7 @@ def get_graphql_query(body): text } } - primaryVideos(first: 1) { + primaryVideos(first: 100) { edges { node { id diff --git a/addon.xml b/addon.xml index 97433dc..42f83bc 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ @@ -32,6 +32,10 @@ Designed for low-end devices and Estuary skin. screenshot-06.jpg +[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 diff --git a/packages/addons.xml b/packages/addons.xml index 7a3dc76..5fd7118 100644 --- a/packages/addons.xml +++ b/packages/addons.xml @@ -4,7 +4,7 @@ @@ -35,6 +35,10 @@ Designed for low-end devices and Estuary skin. screenshot-06.jpg +[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 diff --git a/packages/addons.xml.crc b/packages/addons.xml.crc index cf3b487..9210d8b 100644 --- a/packages/addons.xml.crc +++ b/packages/addons.xml.crc @@ -1 +1 @@ -f2ce6a29d3754634f6f222ca84c0f73d2320033c \ No newline at end of file +76d587191f27f01d12004970f343918989b0fd5a \ No newline at end of file