Ejemplo n.º 1
0
def _display_search_results(pathitems, perpetual_range_start, dir_update_listing):
    search_term = pathitems[2]
    search_results = api.search(search_term, perpetual_range_start)
    if search_results.videos:
        listings.build_video_listing(search_results, g.MAIN_MENU_ITEMS['search'], pathitems)
        _handle_endofdirectory(dir_update_listing)
    else:
        ui.show_notification(common.get_local_string(30013))
        xbmcplugin.endOfDirectory(g.PLUGIN_HANDLE, succeeded=False)
Ejemplo n.º 2
0
def _display_search_results(search_term):
    search_results = api.search(search_term)
    if search_results.videos:
        listings.build_video_listing(search_results,
                                     g.MAIN_MENU_ITEMS['search'])
        return
    else:
        ui.show_notification(common.get_local_string(30013))
        xbmcplugin.endOfDirectory(g.PLUGIN_HANDLE, succeeded=False)
Ejemplo n.º 3
0
 def search(self, pathitems):
     """Ask for a search term if none is given via path, query API
     and display search results"""
     if len(pathitems) == 2:
         # Show 'search term' window
         search_term = ui.ask_for_search_term()
         pathitems.append(search_term)
     else:
         # Do a research
         search_term = pathitems[2]
     if search_term:
         search_results = api.search(search_term, self.perpetual_range_start)
         if search_results.videos:
             listings.build_video_listing(search_results, g.MAIN_MENU_ITEMS['search'], pathitems)
             _handle_endofdirectory(self.dir_update_listing)
         else:
             ui.show_notification(common.get_local_string(30013))
             xbmcplugin.endOfDirectory(g.PLUGIN_HANDLE, succeeded=False)
     else:
         xbmcplugin.endOfDirectory(g.PLUGIN_HANDLE, succeeded=False)