Skip to content

Commit

Permalink
[navigation][search] Fix page redirect that can fails
Browse files Browse the repository at this point in the history
When path redirect fails the context menus that use page refresh
cause side effects for example when you use "add to my list" it open again the search menu
  • Loading branch information
CastagnaIT committed Dec 11, 2023
1 parent 7412b0a commit 248eace
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resources/lib/navigation/directory_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ def search_add():
# (otherwise will retrigger input dialog on Back or Container.Refresh)
if row_id is not None and search_query(row_id, 0, False):
url = common.build_url(['search', 'search', row_id], mode=G.MODE_DIRECTORY, params={'dir_update_listing': True})
from time import sleep
# The forced sleep its needed because seem that change the container path too fast
# make problems in Kodi core and the GUI fails to update, when this happens cause side effects to context menus
# like "add/remove from my list" that when used ask again to make a new search because re-open the initial path
sleep(1)
common.container_update(url, False)
return True
return False
Expand Down

0 comments on commit 248eace

Please sign in to comment.