From 11103347c86da9675b2f298165c1b4e078e69f23 Mon Sep 17 00:00:00 2001 From: sonninnos <45124675+sonninnos@users.noreply.github.com> Date: Sat, 28 Sep 2024 00:36:32 +0300 Subject: [PATCH] Fix playlist search index in XMB+Ozone (#17047) --- menu/drivers/ozone.c | 5 ++++- menu/drivers/xmb.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/menu/drivers/ozone.c b/menu/drivers/ozone.c index 5af0c5df8e..ecd00f18d9 100644 --- a/menu/drivers/ozone.c +++ b/menu/drivers/ozone.c @@ -4191,7 +4191,10 @@ static void ozone_update_content_metadata(ozone_handle_t *ozone) /* Fill entry enumeration */ if (show_entry_idx) { - unsigned long _entry = (unsigned long)(playlist_index + 1); + unsigned long _entry = menu_entries_search_get_terms() + ? (unsigned long)(menu_st->selection_ptr + 1) + : (unsigned long)(playlist_index + 1); + if (ozone->flags & OZONE_FLAG_IS_EXPLORE_LIST) _entry = (unsigned long)(selection + 1); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 3f0447a09c..524d213075 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1660,6 +1660,7 @@ static void xmb_selection_pointer_changed( if (xmb->entry_idx_enabled) { size_t entry_idx_selection = selection + 1; + size_t list_size = MENU_LIST_GET_SELECTION(menu_list, 0)->size; unsigned entry_idx_offset = xmb->entry_index_offset; bool show_entry_idx = (xmb->is_playlist || xmb->is_explore_list) ? true : false; @@ -1676,7 +1677,7 @@ static void xmb_selection_pointer_changed( else snprintf(xmb->entry_index_str, sizeof(xmb->entry_index_str), "%lu/%lu", (unsigned long)entry_idx_selection, - (unsigned long)xmb->list_size); + (unsigned long)list_size); } ia = xmb->items_active_alpha;