Skip to content

Commit

Permalink
Add new input_prompt command for search endpoint to bypass Kodi windo…
Browse files Browse the repository at this point in the history
…w caching
  • Loading branch information
MoojMidge committed Sep 15, 2024
1 parent 076d721 commit eb4237a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions resources/lib/youtube_plugin/kodion/abstract_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self):
self.register_path(r''.join((
'^',
'(', PATHS.SEARCH, '|', PATHS.EXTERNAL_SEARCH, ')',
'/(?P<command>input|query|list|remove|clear|rename)?/?$'
'/(?P<command>input|input_prompt|query|list|remove|clear|rename)?/?$'
)), self.on_search)

self.register_path(r''.join((
Expand Down Expand Up @@ -341,7 +341,7 @@ def on_search(provider, context, re_match):
ui.refresh_container()
return True

if command == 'input':
if command.startswith('input'):
query = None
# came from page 1 of search query by '..'/back
# user doesn't want to input on this path
Expand All @@ -366,7 +366,10 @@ def on_search(provider, context, re_match):
return False

context.set_path(PATHS.SEARCH, 'query')
return provider.on_search_run(context=context, search_text=query)
return (
provider.on_search_run(context=context, search_text=query),
{provider.RESULT_CACHE_TO_DISC: command != 'input_prompt'},
)

context.set_content(CONTENT.LIST_CONTENT)
result = []
Expand Down

0 comments on commit eb4237a

Please sign in to comment.