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 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
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
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
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 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
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 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