Example #1
0
def getMostViewedVideos(catalog, country, categoryId, top):
    country = model.getCountry(catalog, countryName)
    lst = model.sortVideosByViews(videos)
    videos = country["videos"]
    emptyLst = model.emptyList()
    counter = 0
    for video in lt.iterator(lst):
        if (counter < int(top)):
            if (video['country'] == country
                    and video['category_id'] == categoryId):
                lt.addLast(emptyLst, video)
                counter = 1 + counter
    return emptyLst
Example #2
0
def getVideoWithMostTrendingDaysByCountry(catalog, country):
    lstByCountry = country["videos"]
    country = model.getCountry(catalog, countryName)
    lst = model.sortVideosByTrendingDays(catalog)
    trendVid = None
    counter = 0
    for i in lt.iterator(lstByCountry):
        counter2 = 0
        for j in lt.iterator(lstByCountry):
            if (i['video_id'] == j["video_id"]):
                counter2 = counter2 + 1
        if counter < counter2:
            trendVid = i
            counter = counter2
    return trendVid
Example #3
0
def getCountry(catalog, country):
    """
    Retorna la lista asociada a un pais
    """
    return model.getCountry(catalog, country)
Example #4
0
def getCountry(catalog, country):
    """
    Retorna un genero con su informacion.
    """
    return md.getCountry(catalog, country)
def getCountry(countries, country):
    """
    Retorna la informacion de ese pais: nombre + lista de videos correspondientes
    """
    return model.getCountry(countries, country)