Example #1
0
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)
Example #2
0
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)
Example #3
0
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')
Example #4
0
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')
Example #5
0
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)
Example #6
0
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)
Example #7
0
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)
Example #8
0
 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)
Example #9
0
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')
Example #10
0
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')
Example #11
0
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}