From 1a5de7c6f6c04b12abafa163001c06a14836c0e1 Mon Sep 17 00:00:00 2001 From: CastagnaIT Date: Thu, 15 Jul 2021 11:25:40 +0200 Subject: [PATCH] Video sorted lists query changes --- resources/lib/globals.py | 9 ++++++--- .../nfsession/directorybuilder/dir_path_requests.py | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/resources/lib/globals.py b/resources/lib/globals.py index 6bc72f05e..94d1baec3 100644 --- a/resources/lib/globals.py +++ b/resources/lib/globals.py @@ -92,7 +92,8 @@ class GlobalVariables(object): 'loco_known': True, 'request_context_name': 'mylist', 'view': VIEW_MYLIST, - 'has_sort_setting': True}), + 'has_sort_setting': True, + 'query_without_reference': True}), ('continueWatching', {'path': ['video_list', 'continueWatching'], 'loco_contexts': ['continueWatching'], 'loco_known': True}), @@ -111,7 +112,8 @@ class GlobalVariables(object): 'loco_contexts': ['newRelease'], 'loco_known': True, 'request_context_name': 'newrelease', - 'has_sort_setting': True}), + 'has_sort_setting': True, + 'query_without_reference': True}), ('currentTitles', {'path': ['video_list', 'currentTitles'], 'loco_contexts': ['trendingNow'], 'loco_known': True}), @@ -134,7 +136,8 @@ class GlobalVariables(object): 'label_id': 30163, 'description_id': 30164, 'icon': 'DefaultTVShows.png', - 'has_sort_setting': True}), + 'has_sort_setting': True, + 'query_without_reference': True}), ('recommendations', {'path': ['recommendations', 'recommendations'], 'loco_contexts': ['similars', 'becauseYouAdded', 'becauseYouLiked', 'watchAgain', 'bigRow'], diff --git a/resources/lib/services/nfsession/directorybuilder/dir_path_requests.py b/resources/lib/services/nfsession/directorybuilder/dir_path_requests.py index 003a7eeaf..8b4c90a5c 100644 --- a/resources/lib/services/nfsession/directorybuilder/dir_path_requests.py +++ b/resources/lib/services/nfsession/directorybuilder/dir_path_requests.py @@ -172,7 +172,11 @@ def req_video_list_sorted(self, context_name, context_id=None, perpetual_range_s int(G.ADDON.getSettingInt('menu_sortorder_' + menu_data.get('initial_menu_id', menu_data['path'][1]))) ] base_path.append(req_sort_order_type) - paths = build_paths(base_path + [RANGE_PLACEHOLDER], VIDEO_LIST_PARTIAL_PATHS) + _base_path = list(base_path) + _base_path.append(RANGE_PLACEHOLDER) + if not menu_data.get('query_without_reference', False): + _base_path.append('reference') + paths = build_paths(_base_path, VIDEO_LIST_PARTIAL_PATHS) path_response = self.nfsession.perpetual_path_request(paths, [response_type, base_path], perpetual_range_start) return VideoListSorted(path_response, context_name, context_id, req_sort_order_type)