def _search(params):
type = "SERIEN" if params["id"].startswith("serie") else "FILM"
history = utils.get_cache("seriesearch" if type == "SERIEN" else "moviesearch") or {}
if not history or params.get("newsearch"):
a = history if history else "" #####
heading="VAVOO.TO - %s SUCHE" % type
kb = xbmc.Keyboard("", heading, False) #####
kb.doModal()
if (kb.isConfirmed()):
query = kb.getText().replace(".", "%2E")
para = "%s.search=%s" % (params["id"], query)
history[query] = para
utils.set_cache("seriesearch" if type == "SERIEN" else "moviesearch", history, False)
_list({"id" : para})
else: return
else:
for a in history:
cm = [("Suchverlauf löschen", "RunPlugin(%s?action=delete_search&id=%s)" % (sys.argv[0], params["id"])), ("Suche löschen", "RunPlugin(%s?action=delete_search&id=%s&single=%s)" % (sys.argv[0], params["id"], a))]
addDir2(a, "DefaultAddonsSearch", "list", context=cm, id=history[a])
addDir2("Neue Suche", "DefaultAddonsSearch", "search", id=params["id"], newsearch=True)
utils.end()