Example #1
0
def channelVideos(name):
    items = [{
        'label':
        PLUGIN.get_string(30078),
        'icon':
        Images.ICON,
        'thumbnail':
        Images.THUMB,
        'art':
        utils.theArt(),
        'path':
        PLUGIN.url_for(endpoint='channelVideosList',
                       name=name,
                       index=0,
                       past='true')
    }, {
        'label':
        PLUGIN.get_string(30079),
        'icon':
        Images.ICON,
        'thumbnail':
        Images.THUMB,
        'art':
        utils.theArt(),
        'path':
        PLUGIN.url_for(endpoint='channelVideosList',
                       name=name,
                       index=0,
                       past='false')
    }]
    PLUGIN.set_content(utils.getContentType())
    return items
def channelVideos(name):
    items = [{'label': PLUGIN.get_string(30078), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, past='true')},
             {'label': PLUGIN.get_string(30079), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, past='false')}]
    PLUGIN.set_content(utils.getContentType())
    return items
Example #3
0
def createListOfFeaturedStreams():
    featuredStreams = TWITCHTV.getFeaturedStream()
    utils.refreshPreviews()
    PLUGIN.set_content(utils.getContentType())
    return [
        CONVERTER.convertStreamToListItem(featuredStream[Keys.STREAM])
        for featuredStream in featuredStreams
    ]
Example #4
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
Example #5
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
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
Example #8
0
def channelVideosList(name, index, broadcast_type):
    index = int(index)
    offset = index * 8
    videos = TWITCHTV.getFollowerVideos(name, offset, broadcast_type)
    items = [CONVERTER.convertVideoListToListItem(video) for video in videos[Keys.VIDEOS]]
    if videos[Keys.TOTAL] > (offset + 8):
        items.append(utils.linkToNextPage('channelVideosList', index, name=name, broadcast_type=broadcast_type))
    PLUGIN.set_content(utils.getContentType())
    return items
Example #9
0
def channelVideos(name):
    items = [{'label': PLUGIN.get_string(30078), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, broadcast_type='archive')},
             {'label': PLUGIN.get_string(30113), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, broadcast_type='upload')},
             {'label': PLUGIN.get_string(30079), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, broadcast_type='highlight')}]
    PLUGIN.set_content(utils.getContentType())
    return items
Example #10
0
def createFollowingGameList():
    username = utils.getUserName()
    if not username:
        utils.notification(PLUGIN.get_string(30095))
    else:
        games = TWITCHTV.getFollowingGames(username)
        items = [CONVERTER.convertGameToListItem(element) for element in games]
        PLUGIN.set_content(utils.getContentType())
        return items
Example #11
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
Example #12
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
Example #13
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
Example #14
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
Example #15
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
Example #16
0
def createFollowingGameList():
    username = utils.getUserName()
    if not username:
        utils.notification(PLUGIN.get_string(30095))
    else:
        games = TWITCHTV.getFollowingGames(username)
        items = [CONVERTER.convertGameToListItem(element) for element in games]
        PLUGIN.set_content(utils.getContentType())
        return items
Example #17
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
Example #18
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
Example #19
0
def createListOfFeaturedStreams():
    featuredStreams = TWITCHTV.getFeaturedStream()
    utils.refreshPreviews()
    PLUGIN.set_content(utils.getContentType())
    return [CONVERTER.convertStreamToListItem(featuredStream[Keys.STREAM])
            for featuredStream in featuredStreams]
Example #20
0
def createListOfTeamStreams(team):
    PLUGIN.set_content(utils.getContentType())
    return [CONVERTER.convertTeamChannelToListItem(channel[Keys.CHANNEL])
            for channel in TWITCHTV.getTeamStreams(team)]
Example #21
0
def createMainListing():
    context_menu = []
    context_menu.extend(utils.contextClearPreviews())
    items = [
        {'label': PLUGIN.get_string(30005),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfFeaturedStreams')
         },
        {'label': PLUGIN.get_string(30001),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfGames', index='0')
         },
        {'label': PLUGIN.get_string(30008),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfChannels', index='0')
         },
        {'label': PLUGIN.get_string(30002),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createFollowingList')
         },
        {'label': PLUGIN.get_string(30066),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createFollowingGameList')
         },
        {'label': PLUGIN.get_string(30006),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfTeams', index='0')
         },
        {'label': PLUGIN.get_string(30098),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListForSelectedVideo')
         },
        {'label': PLUGIN.get_string(30003),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='search')
         },
        {'label': PLUGIN.get_string(30004),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='showSettings')
         }
    ]
    PLUGIN.set_content(utils.getContentType())
    return items
Example #22
0
def createListOfTeamStreams(team):
    PLUGIN.set_content(utils.getContentType())
    return [CONVERTER.convertTeamChannelToListItem(channel[Keys.CHANNEL])
            for channel in TWITCHTV.getTeamStreams(team)]
Example #23
0
def createMainListing():
    context_menu = []
    context_menu.extend(utils.contextClearPreviews())
    items = [
        {'label': PLUGIN.get_string(30005),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfFeaturedStreams')
         },
        {'label': PLUGIN.get_string(30001),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfGames', index='0')
         },
        {'label': PLUGIN.get_string(30008),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfChannels', index='0')
         },
        {'label': PLUGIN.get_string(30002),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createFollowingList')
         },
        {'label': PLUGIN.get_string(30066),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createFollowingGameList')
         },
        {'label': PLUGIN.get_string(30006),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfTeams', index='0')
         },
        {'label': PLUGIN.get_string(30098),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListForSelectedVideo')
         },
        {'label': PLUGIN.get_string(30003),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='search')
         },
        {'label': PLUGIN.get_string(30004),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='showSettings')
         }
    ]
    PLUGIN.set_content(utils.getContentType())
    return items