From 20f46434a346af069dc5f2622f251cc80b74f1e0 Mon Sep 17 00:00:00 2001 From: Florian Bischof Date: Fri, 29 Dec 2023 15:34:20 +0100 Subject: [PATCH] fix: Showing "Browse subgenres" folder coming from "Previous page" --- .../services/nfsession/directorybuilder/dir_builder_items.py | 3 ++- .../services/nfsession/directorybuilder/dir_builder_utils.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/lib/services/nfsession/directorybuilder/dir_builder_items.py b/resources/lib/services/nfsession/directorybuilder/dir_builder_items.py index 50dfe691f..36ce64324 100644 --- a/resources/lib/services/nfsession/directorybuilder/dir_builder_items.py +++ b/resources/lib/services/nfsession/directorybuilder/dir_builder_items.py @@ -268,7 +268,8 @@ def build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None for videoid_value, video in video_list.videos.items()] # If genre_id exists add possibility to browse LoCo sub-genres - if sub_genre_id and sub_genre_id != 'None': + # With checking if 'previous_start' is existing, we know that it is the first page + if sub_genre_id and sub_genre_id != 'None' and 'previous_start' not in video_list.perpetual_range_selector: # Create dynamic sub-menu info in MAIN_MENU_ITEMS menu_id = f'subgenre_{sub_genre_id}' sub_menu_data = menu_data.copy() diff --git a/resources/lib/services/nfsession/directorybuilder/dir_builder_utils.py b/resources/lib/services/nfsession/directorybuilder/dir_builder_utils.py index 487f959de..7905fe2e1 100644 --- a/resources/lib/services/nfsession/directorybuilder/dir_builder_utils.py +++ b/resources/lib/services/nfsession/directorybuilder/dir_builder_utils.py @@ -23,7 +23,7 @@ def add_items_previous_next_page(directory_items, pathitems, perpetual_range_sel if pathitems and perpetual_range_selector: if 'previous_start' in perpetual_range_selector: params = {'perpetual_range_start': perpetual_range_selector.get('previous_start'), - 'sub_genre_id': sub_genre_id if perpetual_range_selector.get('previous_start') == 0 else None} + 'sub_genre_id': sub_genre_id} if path_params: params.update(path_params) previous_page_item = ListItemW(label=common.get_local_string(30148)) @@ -33,7 +33,8 @@ def add_items_previous_next_page(directory_items, pathitems, perpetual_range_sel previous_page_item, True)) if 'next_start' in perpetual_range_selector: - params = {'perpetual_range_start': perpetual_range_selector.get('next_start')} + params = {'perpetual_range_start': perpetual_range_selector.get('next_start'), + 'sub_genre_id': sub_genre_id} if path_params: params.update(path_params) next_page_item = ListItemW(label=common.get_local_string(30147))