Beispiel #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
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
Beispiel #3
0
def createListOfFeaturedStreams():
    featuredStreams = TWITCHTV.getFeaturedStream()
    utils.refreshPreviews()
    PLUGIN.set_content(utils.getContentType())
    return [
        CONVERTER.convertStreamToListItem(featuredStream[Keys.STREAM])
        for featuredStream in featuredStreams
    ]
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
Beispiel #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
def createFollowingList():
    username = utils.getUserName()
    if not username:
        utils.notification(PLUGIN.get_string(30095))
    else:
        streams = TWITCHTV.getFollowingStreams(username)
        liveStreams = [CONVERTER.convertStreamToListItem(stream) for stream in streams[Keys.LIVE]]
        liveStreams.insert(0, {'path': PLUGIN.url_for(endpoint='createFollowingList'), 'icon': Images.ICON,
                               'thumbnail': Images.THUMB, 'art': utils.theArt(), 'is_playable': False,
                               'label': PLUGIN.get_string(30012)})
        liveStreams.append({'path': PLUGIN.url_for(endpoint='createFollowingList'), 'icon': Images.ICON,
                            'thumbnail': Images.THUMB, 'art': utils.theArt(), 'is_playable': False,
                            'label': PLUGIN.get_string(30013)})
        liveStreams.extend([CONVERTER.convertFollowersToListItem(follower) for follower in streams[Keys.OTHERS]])
        utils.refreshPreviews()
        PLUGIN.set_content(utils.getContentType())
        return liveStreams
Beispiel #7
0
def createFollowingList():
    username = utils.getUserName()
    if not username:
        utils.notification(PLUGIN.get_string(30095))
    else:
        streams = TWITCHTV.getFollowingStreams(username)
        liveStreams = [CONVERTER.convertStreamToListItem(stream) for stream in streams[Keys.LIVE]]
        liveStreams.insert(0, {'path': PLUGIN.url_for(endpoint='createFollowingList'), 'icon': Images.ICON,
                               'thumbnail': Images.THUMB, 'art': utils.theArt(), 'is_playable': False,
                               'label': PLUGIN.get_string(30012)})
        liveStreams.append({'path': PLUGIN.url_for(endpoint='createFollowingList'), 'icon': Images.ICON,
                            'thumbnail': Images.THUMB, 'art': utils.theArt(), 'is_playable': False,
                            'label': PLUGIN.get_string(30013)})
        liveStreams.extend([CONVERTER.convertFollowersToListItem(follower) for follower in streams[Keys.OTHERS]])
        utils.refreshPreviews()
        PLUGIN.set_content(utils.getContentType())
        return liveStreams
def createListOfFeaturedStreams():
    featuredStreams = TWITCHTV.getFeaturedStream()
    utils.refreshPreviews()
    PLUGIN.set_content(utils.getContentType())
    return [CONVERTER.convertStreamToListItem(featuredStream[Keys.STREAM])
            for featuredStream in featuredStreams]