def search(): kb = xbmc.Keyboard() kb.setHeading("Cerca un programma") kb.doModal() if kb.isConfirmed(): text = kb.getText().decode('utf8') search = Search() items = search.searchText(text.encode('utf8')) show_search_result(items)
def show_themes(): search = Search() for position, tematica in enumerate(search.tematiche): liStyle = xbmcgui.ListItem(tematica) addDirectoryItem({"mode": "get_last_content_by_tag", "tags": "Tematica:"+search.tematiche[int(position)]}, liStyle) xbmcplugin.addSortMethod(handle, xbmcplugin.SORT_METHOD_LABEL) xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
def show_news_providers(): search = Search() for k, v in search.newsProviders.iteritems(): liStyle = xbmcgui.ListItem(k) addDirectoryItem({"mode": "get_last_content_by_tag", "tags": search.newsProviders[k]}, liStyle) xbmcplugin.addSortMethod(handle, xbmcplugin.SORT_METHOD_LABEL) xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
def show_tg_root(): search = Search() for k, v in search.newsArchives.iteritems(): liStyle = xbmcgui.ListItem(k) addDirectoryItem({"mode": "get_last_content_by_tag", "tags": search.newsArchives[k]}, liStyle) liStyle = xbmcgui.ListItem("TGR", thumbnailImage="http://www.tgr.rai.it/dl/tgr/mhp/immagini/splash.png") addDirectoryItem({"mode": "tgr"}, liStyle) xbmcplugin.addSortMethod(handle, xbmcplugin.SORT_METHOD_LABEL) xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
def get_most_visited(tags): xbmc.log("Get most visited for tags: " + tags) search = Search() items = search.getMostVisited(tags) show_search_result(items)
def get_last_content_by_tag(tags): xbmc.log("Get latest content for tags: " + tags) search = Search() items = search.getLastContentByTag(tags) show_search_result(items)
def get_most_visited(tags): search = Search() items = search.getMostVisited(tags) show_search_result(items)
def get_last_content_by_tag(tags): search = Search() items = search.getLastContentByTag(tags) show_search_result(items)
def show_themes(): search = Search()
def show_news_providers(): search = Search()