Exemplo n.º 1
0
def searchresults(query, index='0'):
    index, offset, limit = utils.calculatePaginationValues(index)
    streams = TWITCHTV.searchStreams(query, offset, limit)
    items = [CONVERTER.convertStreamToListItem(stream) for stream in streams]
    items.append(utils.linkToNextPage('searchresults', index, query=query))
    utils.refreshPreviews()
    PLUGIN.set_content(utils.getContentType())
    return items
Exemplo n.º 2
0
def createListOfTeams(index):
    index = int(index)
    teams = TWITCHTV.getTeams(index)
    items = [CONVERTER.convertTeamToListItem(item) for item in teams]
    if len(teams) == 25:
        items.append(utils.linkToNextPage('createListOfTeams', index))
    PLUGIN.set_content(utils.getContentType())
    return items
Exemplo n.º 3
0
def createListOfGames(index):
    index, offset, limit = utils.calculatePaginationValues(index)

    games = TWITCHTV.getGames(offset, limit)
    items = [CONVERTER.convertGameToListItem(element[Keys.GAME]) for element in games]

    items.append(utils.linkToNextPage('createListOfGames', index))
    PLUGIN.set_content(utils.getContentType())
    return items
Exemplo n.º 4
0
def channelVideosList(name, index, past):
    index = int(index)
    offset = index * 8
    videos = TWITCHTV.getFollowerVideos(name, offset, past)
    items = [CONVERTER.convertVideoListToListItem(video) for video in videos[Keys.VIDEOS]]
    if videos[Keys.TOTAL] > (offset + 8):
        items.append(utils.linkToNextPage('channelVideosList', index, name=name, past=past))
    PLUGIN.set_content(utils.getContentType())
    return items
Exemplo n.º 5
0
def createListForGame(gameName, index):
    index, offset, limit = utils.calculatePaginationValues(index)
    items = [CONVERTER.convertStreamToListItem(stream) for stream
             in TWITCHTV.getGameStreams(gameName, offset, limit)]

    items.append(utils.linkToNextPage('createListForGame', index, gameName=gameName))
    utils.refreshPreviews()
    PLUGIN.set_content(utils.getContentType())
    return items
Exemplo n.º 6
0
def createListOfGames(index):
    index, offset, limit = utils.calculatePaginationValues(index)

    games = TWITCHTV.getGames(offset, limit)
    items = [
        CONVERTER.convertGameToListItem(element[Keys.GAME])
        for element in games
    ]

    items.append(utils.linkToNextPage('createListOfGames', index))
    PLUGIN.set_content(utils.getContentType())
    return items
Exemplo n.º 7
0
def createListForGame(gameName, index):
    index, offset, limit = utils.calculatePaginationValues(index)
    items = [
        CONVERTER.convertStreamToListItem(stream)
        for stream in TWITCHTV.getGameStreams(gameName, offset, limit)
    ]

    items.append(
        utils.linkToNextPage('createListForGame', index, gameName=gameName))
    utils.refreshPreviews()
    PLUGIN.set_content(utils.getContentType())
    return items
Exemplo n.º 8
0
def channelVideosList(name, index, past):
    index = int(index)
    offset = index * 8
    videos = TWITCHTV.getFollowerVideos(name, offset, past)
    items = [
        CONVERTER.convertVideoListToListItem(video)
        for video in videos[Keys.VIDEOS]
    ]
    if videos[Keys.TOTAL] > (offset + 8):
        items.append(
            utils.linkToNextPage('channelVideosList',
                                 index,
                                 name=name,
                                 past=past))
    PLUGIN.set_content(utils.getContentType())
    return items