示例#1
0
def make_index_list():
    try:
        index = comm.get_index()
        ok = True
        for i in index:
            if 'url' in i:
                url = "%s?%s" % (sys.argv[0], utils.make_url({
                                 'category': i['name']}))
                listitem = xbmcgui.ListItem(i['name'])
                # Add the program item to the list
                ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
                                                 url=url, listitem=listitem,
                                                 isFolder=True)

        listitem = xbmcgui.ListItem(label='Settings')
        ok = xbmcplugin.addDirectoryItem(
            handle=int(sys.argv[1]),
            url="{0}?action=settings".format(sys.argv[0]),
            listitem=listitem,
            isFolder=False)

        xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=ok)
        xbmcplugin.setContent(handle=int(sys.argv[1]), content='episodes')
    except Exception:
        utils.handle_error('Unable to build index')
示例#2
0
def make_series_list():
    utils.log("Showing series list")
    try:
        series_list = comm.get_index()
        series_list.sort()

        ok = True
        for s in series_list:
            url = "%s?series_id=%s" % (sys.argv[0], s.id)
            thumbnail = s.get_thumbnail()

            # Thumbnail that doesn't exist breaks XBMC 12
            listitem = xbmcgui.ListItem(s.get_title())
            if thumbnail:
                listitem = xbmcgui.ListItem(s.get_title(), iconImage=thumbnail, thumbnailImage=thumbnail)

            listitem.setInfo("video", {"plot": s.get_description()})

            # add the item to the media list
            ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=listitem, isFolder=True)

        xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=ok)
        xbmcplugin.setContent(handle=int(sys.argv[1]), content="tvshows")
    except:
        utils.handle_error("Unable to fetch series listing")
示例#3
0
def make_index_list():
    print "hasdhsadhsa"
    utils.log('g2')
    try:
        utils.log('hello')
        index = comm.get_index()['contentStructure'].get('menu')
        ok = True
        for i in index:
            url = "%s?%s" % (sys.argv[0], utils.make_url({
                             'category': i}))
            listitem = xbmcgui.ListItem(i)
            # Add the program item to the list
            ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
                                             url=url, listitem=listitem,
                                             isFolder=True)

        listitem = xbmcgui.ListItem(label='Settings')
        ok = xbmcplugin.addDirectoryItem(
            handle=int(sys.argv[1]),
            url="{0}?action=settings".format(sys.argv[0]),
            listitem=listitem,
            isFolder=False)

        xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=ok)
        xbmcplugin.setContent(handle=int(sys.argv[1]), content='episodes')
    except Exception:
        utils.handle_error('Unable to build index')
示例#4
0
def make_series_list():
    try:
        series_list = comm.get_index()
        series_list.sort()

        ok = True
        for s in series_list:
            url = "%s?series_id=%s" % (sys.argv[0], s.id)
            thumbnail = s.get_thumbnail()

            listitem = xbmcgui.ListItem(s.get_title(),
                                        iconImage=thumbnail,
                                        thumbnailImage=thumbnail)
            listitem.setInfo('video', {'plot': s.get_description()})

            # add the item to the media list
            ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
                                             url=url,
                                             listitem=listitem,
                                             isFolder=True)

        xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=ok)
        xbmcplugin.setContent(handle=int(sys.argv[1]), content='tvshows')
    except:
        d = xbmcgui.Dialog()
        message = utils.dialog_error("Unable to fetch listing")
        d.ok(*message)
        utils.log_error()
示例#5
0
def make_series_list():
    try:
        series_list = comm.get_index()
        series_list.sort()

        # fill media list
        ok = fill_series_list(series_list)
    except:
        # oops print error message
        d = xbmcgui.Dialog()
        message = utils.dialog_error("Unable to fetch listing")
        d.ok(*message)
        utils.log_error()
        ok = False

    # send notification we're finished, successfully or unsuccessfully
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=ok)
示例#6
0
def make_series_list():
	try:
		series_list = comm.get_index()
		series_list.sort()

		# fill media list
		ok = fill_series_list(series_list)
	except:
		# oops print error message
		d = xbmcgui.Dialog()
		message = utils.dialog_error("Unable to fetch listing")
		d.ok(*message)
		utils.log_error();
		ok = False

	# send notification we're finished, successfully or unsuccessfully
	xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=ok)
示例#7
0
def make_index_list():

    try:
        index = comm.get_index()
        ok = True
        for i in index:
            if 'url' in i:
                url = "%s?%s" % (sys.argv[0], utils.make_url({
                                 'category': i['name']}))
                listitem = xbmcgui.ListItem(i['name'])
                # Add the program item to the list
                ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
                                                 url=url, listitem=listitem,
                                                 isFolder=True)

        xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=ok)
        xbmcplugin.setContent(handle=int(sys.argv[1]), content='episodes')
    except:
        utils.handle_error()
示例#8
0
def make_series_list():
    try:
        series_list = comm.get_index()
        series_list.sort()

        ok = True
        for s in series_list:
            url = "%s?series_id=%s" % (sys.argv[0], s.id)
            thumbnail = s.get_thumbnail()

            listitem = xbmcgui.ListItem(s.get_title(), iconImage=thumbnail, thumbnailImage=thumbnail)
            listitem.setInfo('video', { 'plot' : s.get_description() })
            
            # add the item to the media list
            ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=listitem, isFolder=True)

        xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=ok)
        xbmcplugin.setContent(handle=int(sys.argv[1]), content='tvshows')
    except:
        utils.handle_error("Unable to fetch series listing")