Redirect inside plugin
#1
Hello.

Tried to find answer to my question with no luck, so asking for a help.

In my plugin I have an url like "/search" where I check for a query and ask user to fill it in.
Then I want to redirect user to page like "/search?q=query".

And there goes the question how to properly make redirect to new plugin url?
Tried with RPC's call to "Addons.ExecuteAddon", but that is opening like a new window and ".." (return to previous page) is opening wrong url.

Any better way to do redirect?

PS: I'm not redirecting to video, but to a list of search results, which I want to have as a separate url.
Reply
#2
I dont get it. Make /search a directory. Upon call from kodi show keyboard, then return list. Why a second url?

If it is for saved search have a look at eg the youtube addon.
Reply
#3
(2017-05-26, 10:41)ironic_monkey Wrote: I dont get it. Make /search a directory. Upon call from kodi show keyboard, then return list. Why a second url?

By default I list search history as a listitems (each one with url like "/search/?q=query1"), and a separate listitem with "/search/?keyboard", which asks user to enter new query.
When query is entered - I want to redirect to that query results.
If search history is empty - keyboard input is fired by default, so there is a resulting redirect as well.
Reply
#4
Looked over Youtube plugin and looks their approach is doing the right thing:

Code:
xbmc.executebuiltin("Container.Update(%s)" % url)
Reply
#5
for every search query history just create it as xbmcplugin.addDirectoryItem(...)
Reply

Logout Mark Read Team Forum Stats Members Help
Redirect inside plugin0