def _(): charlist, statuslist, yearlist = request.parse(plugin.path, 'FilterListParser') genrelist = [ 'Action', 'Adventure', 'Comedy', 'Crime', 'Drama', 'Fantasy', 'Horror', 'Mystery', 'Romance', 'Sci-fi', 'Thriller' ] dialog = FilterDialog(charlist, genrelist, statuslist, yearlist) dialog.doModal() if not dialog.cancelled: dramalist = request.parse(plugin.path, 'CharGenreStatusYearDramaListParser', **dialog.result()) idb.connect() items = [] for (path, poster, info) in idb.fetchall(dramalist): item = ListItem(info['title']) item.setArt({'poster': poster}) item.setInfo('video', info) items.append((url_for(path), item, True)) idb.close() show(items, 'tvshows', True)
def _(): (path, serverlist, titlelist, title) = request.parse(plugin.path, 'ServerListParser') position = Dialog().select(_addon.getLocalizedString(33500), titlelist) item = ListItem(title) url = False if position != -1: xbmc.executebuiltin('ActivateWindow(busydialognocancel)') resolveurl.add_plugin_dirs(_plugins) try: url = resolveurl.resolve(serverlist[position]) if url: edb.connect() edb.add(path) edb.close() item.setPath(url) subtitle = request.subtitle(serverlist[position]) if subtitle: item.setSubtitles([subtitle]) else: Dialog().notification(_addon.getLocalizedString(33502), '') except: Dialog().notification(_addon.getLocalizedString(33501), '') xbmc.executebuiltin('Dialog.Close(busydialognocancel)') else: xbmc.executebuiltin('Playlist.Clear') xbmc.sleep(500) xbmcplugin.setResolvedUrl(plugin.handle, isinstance(url, str), item)
def _(): items = [] for (path, title) in request.parse(plugin.path, 'EpisodeListParser'): item = ListItem(title) item.setInfo('video', {}) item.setProperty('IsPlayable', 'true') items.append((url_for(path), item, False)) show(items, 'episodes')
def _(): items = [] (starlist, paginationlist) = request.parse(plugin.full_path, 'StarSearchPaginationListParser') for (path, poster, title) in starlist: item = ListItem(title) item.setArt({'poster': poster}) items.append((url_for(path), item, True)) append_pagination(items, paginationlist) show(items, 'artists')
def _(): idb.connect() items = [] for (path, poster, info) in idb.fetchall( request.parse(plugin.path, 'StarDramaListParser')): item = ListItem(info['title']) item.setArt({'poster': poster}) item.setInfo('video', info) items.append((url_for(path), item, True)) idb.close() show(items, 'tvshows', True)
def _(): (starlist, paginationlist) = request.parse(plugin.full_path, 'StarPaginationListParser') items = [] for (path, poster, title, plot) in starlist: item = ListItem(title) item.setArt({'poster': poster}) item.setInfo('video', {'plot': plot}) items.append((url_for(path), item, True)) append_pagination(items, paginationlist) show(items)
def create(): _connection.execute('CREATE TABLE IF NOT EXISTS drama (' 'path TEXT PRIMARY KEY ON CONFLICT IGNORE, ' 'poster TEXT, ' 'title TEXT, ' 'plot TEXT, ' 'year INT)') cursor = _connection.execute('SELECT path FROM drama') result = {path for (path, ) in cursor.fetchall()} for path in request.parse('/drama-list', 'DramaListParser'): if path not in result: add(path)
def get(self): blueprint = self.__class__.blueprint csv_path = self.__class__.csv_path response = flask.jsonify({}), 444 try: args = request.parse(flask.request.args, blueprint) csv = CsvFile(csv_path, blueprint) lines = list([csv.cast_row(row) for row in csv.query(args)]) csv.close() response = flask.jsonify({'data': lines}), 200 except ValueError as e: response = flask.jsonify({'message': str(e)}), 400 except Exception as e: traceback.print_exc() response = flask.jsonify({'message': str(e)}), 500 return flask.make_response(response)
def _(): items = [] (dramalist, paginationlist) = request.parse(plugin.full_path, 'DramaPaginationListParser') idb.connect() for path in dramalist: (poster, info) = idb.fetchone(path) item = ListItem(info['title']) item.setArt({'poster': poster}) item.setInfo('video', info) items.append((url_for(path), item, True)) idb.close() append_pagination(items, paginationlist) show(items, 'tvshows')
def _(): (recentlylist, paginationlist) = request.parse(plugin.full_path, 'RecentlyPaginationListParser') idb.connect() items = [] for (path, poster, title) in recentlylist: item = ListItem(title) item.setArt({'poster': poster}) item.setInfo('video', idb.fetchplot(poster)) item.setProperty('IsPlayable', 'true') items.append((url_for(path), item, False)) idb.close() append_pagination(items, paginationlist) show(items, 'tvshows')
def add(path): (poster, title, plot, year) = request.parse(path, 'DramaDetailParser') _connection.execute('INSERT INTO drama VALUES (?, ?, ?, ?, ?)', (path, poster, title, plot, year)) return poster, {'title': title, 'plot': plot, 'year': year}