Global Search - Video Addon Search Capability - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151) +---- Thread: Global Search - Video Addon Search Capability (/showthread.php?tid=370266) |
Global Search - Video Addon Search Capability - PStew - 2022-11-04 Hello Kodi Community, This is my second post to the community, but we are large Kodi enthusiast around our home! I had some issues with my first post, my apologizes. I hope I have remedied them for conversation's sake. I hope this is the proper category to post this issue in. With a now established account, I look forward to opening communication with the community. My Issue: Overall: I have been working on a custom skin for our home distributions of Kodi 19. I am developing on Windows. I have a button on my home screen (Home.xml & IncludesMainMenu.xml) that accesses the GlobalSearch program addon which then searches my entire local library. I have a second button on my home screen that directly searches through a specific video addon (hard coded) search capabilities. I would love to combine to two into one button. Given GlobalSearch, I figured the easiest route would simply be adding an if statement in a content check function of GlobalSearch itself. I seemingly have located where I needed to be, the _check_focus() method in: \user\AppData\Roaming\Kodi\addons\script.globalsearch\lib\gui.py I have negated the dialog popup (everything commented out) and attempted to open a new search dialog popup from an addon with the ActivateWindow command. I am currently gaining knowledge of the communities' guidelines on posting about addons, so I hope my post is acceptable. My Code: def _check_focus(self): self.getControl(SEARCHCATEGORY).setVisible(False) self.getControl(SEARCHBUTTON).setVisible(True) if self.focusset == 'false': xbmc.executebuiltin("ActivateWindow(Videos, 'plugin://plugin.video.myAddon/?mode=5')") #self.getControl(NORESULTS).setVisible(True) #self.setFocus(self.getControl(SEARCHBUTTON)) #dialog = xbmcgui.Dialog() #ret = dialog.yesno(xbmc.getLocalizedString(284), LANGUAGE(32298)) #if ret: # self._new_search() #else: # self._close() What My Code Does: In theory, I thought, it would simply find no search results locally and instead of a dialog box for no results, it would bring up the search dialog box of the addon. As it is above, opens the normal MyVideoNav.xml when you search for something that is not currently in the local video library. Codes Attempted: Everything attempted below was also attempted with Videos in place of 10025 as well: xbmc.executebuiltin(RunScript(ActivateWindow(10025, "plugin://plugin.video.myAddon/?mode=5"))) xbmc.executebuiltin("RunScript(ActivateWindow(10025, "plugin://plugin.video.myAddon/?mode=5"))") xbmc.executebuiltin(RunScript("ActivateWindow(10025, "plugin://plugin.video.myAddon/?mode=5")")) xbmc.executebuiltin(xbmc.RunScript(xbmc.ActivateWindow(10025, "plugin://plugin.video.myAddon/?mode=5"))) xbmc.executebuiltin("xbmc.RunScript(xbmc.ActivateWindow(10025, "plugin://plugin.video.myAddon/?mode=5"))") Goal: The overall goal is for the button to search the local library first; if nothing is found it automatically searches the addon that's hardcoded. That way a second search dialog box does not pop up and it simply displays the results of the addon. A seamless integration of a video addon's search function into GlobalSearch. In the case of the code I have above, I am simply trying to access the addon and cannot. If anyone has any suggestions on tying GlobalSearch to an addon's search functionalities, I would greatly appreciate them. Ideas:
Essentially: Does anyone spot an error in the methodology being used here? What in the code am I missing? Any suggestions are welcomed. Thanks, PStew |