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))