def explore(section): plugin.set_content("movies") section = Section.find(section) sf = container.search_filter(section) header = [ {"label": lang(34000), "path": plugin.url_for("search_index", section=section.filter_val)}, {"label": lang(34001), "path": plugin.url_for("genre_index", section=section.filter_val)} if section != Section.ANIME else None, {"label": lang(34002), "path": plugin.url_for("bookmarks_index", section=section.filter_val)}, {"label": lang(34011), "path": plugin.url_for("history_index", section=section.filter_val)}, ] header = [h for h in header if h is not None] make_search(sf, header)
def do_search(section, name): plugin.set_content('movies') section = Section.find(section) sf = container.search_filter(section=section, name=str(name)) if not make_search(sf): notify(lang(40312) % ensure_unicode(name)) elif plugin.request.arg('new'): storage = container.search_storage() recent = storage.get('search_recent', []) if name in recent: recent.remove(name) recent.append(name) storage['search_recent'] = recent count = plugin.get_setting('search-items-count', int) if len(recent) > count: del recent[:len(recent)-count]
def by_genre(section, genre): plugin.set_content("movies") section = Section.find(section) genre = Genre.find(genre) or unicode(genre) sf = container.search_filter(section, genres=[genre]) make_search(sf)