예제 #1
0
def searchByTag(catalog, videos, tag, country):
    '''
    Busca N videos con un tag especifico en un pais
    '''
    tag = '"' + tag + '"'
    vidsCountry = model.getVideosByCountry(catalog, country)
    vidsConTag = model.filterVidsByTag(vidsCountry, tag)
    result = model.sortVideos(vidsConTag, videos, 'likes')
    return result
예제 #2
0
def getVideosByCountry(catalog, countryName):
    """
    Args:
        catalog: Catálogo de videos.
        countryName: Nombre del país para flitrar los videos.

    Return:
        list: catálogo filtrado por el nombre del país.
    """
    country = model.getVideosByCountry(catalog, countryName)
    return country
예제 #3
0
def getVideosByCountry(catalog, country):
    """
    Retorna los videos del país seleccionado
    """
    deltatime = -1.0
    deltamemory = -1.0

    tracemalloc.start()
    starttime = getTime()
    startmemory = getMemory()

    videos = model.getVideosByCountry(catalog, country)

    stopmemory = getMemory()
    stoptime = getTime()
    tracemalloc.stop()

    deltatime = stoptime - starttime
    deltamemory = deltaMemory(startmemory, stopmemory)
    return videos, deltatime, deltamemory
예제 #4
0
def getVideoByTrendingAndCountry(catalog, country):
    delta_time = -1.0
    delta_memory = -1.0

    tracemalloc.start()
    start_time = getTime()
    start_memory = getMemory()

    videos = model.getVideosByCountry(catalog, country)
    size = lt.size(videos)
    videos = model.sortVideosByID(videos, size)
    video = model.getNumByID(videos)

    stop_memory = getMemory()
    stop_time = getTime()
    tracemalloc.stop()

    delta_time = stop_time - start_time
    delta_memory = deltaMemory(start_memory, stop_memory)
    delta = delta_time, delta_memory
    return video, delta
예제 #5
0
def getVideosByCountry(catalog, country):
    """
    Retorna los videos de un país específico, el tiempo de
    procesamiento y la memoria alocada
    """
    deltatime = -1.0
    deltamemory = -1.0

    tracemalloc.start()
    starttime = getTime()
    startmemory = getMemory()

    videos = model.getVideosByCountry(catalog, country)

    stopmemory = getMemory()
    stoptime = getTime()
    tracemalloc.stop()

    deltatime = stoptime - starttime
    deltamemory = deltaMemory(startmemory, stopmemory)
    return videos, deltatime, deltamemory
예제 #6
0
def getVideosByCountryAndTags(catalog, country, tag):
    delta_time = -1.0
    delta_memory = -1.0

    tracemalloc.start()
    start_time = getTime()
    start_memory = getMemory()

    videos = model.getVideosByCountry(catalog, country)
    size = lt.size(videos)
    videos = model.getVideosByTags(videos, tag, size)
    size = lt.size(videos)
    videos_sorted = model.sortVideos(videos, int(size))

    stop_memory = getMemory()
    stop_time = getTime()
    tracemalloc.stop()

    delta_time = stop_time - start_time
    delta_memory = deltaMemory(start_memory, stop_memory)
    delta = delta_time, delta_memory
    return videos_sorted, delta
예제 #7
0
def getVideosByCategoryAndCountry(catalog, category, country):
    delta_time = -1.0
    delta_memory = -1.0

    tracemalloc.start()
    start_time = getTime()
    start_memory = getMemory()

    category_id = model.cmpVideosCategoryID(catalog, category)
    videos = model.getVideosByCountry(catalog, country)
    size = lt.size(videos)
    videos = model.getVideosByCategoryR1(videos, int(size), category_id)
    size2 = lt.size(videos)
    videos_sorted = model.sortVideosByViews(videos, int(size2))

    stop_memory = getMemory()
    stop_time = getTime()
    tracemalloc.stop()

    delta_time = stop_time - start_time
    delta_memory = deltaMemory(start_memory, stop_memory)
    delta = delta_time, delta_memory
    return videos_sorted, delta
예제 #8
0
def getVideosByCountry(catalog, country):

    return model.getVideosByCountry(catalog, country)
예제 #9
0
def getVideosByCountry(catalog, country):
    """
    Retorna los videos dado un pais
    """
    videos = model.getVideosByCountry(catalog, country)
    return videos
예제 #10
0
def getVideosCountry(catalog, country, category):
    videos = model.getVideosByCountry(catalog, country, category)
    return videos
예제 #11
0
def getVideosByCountry(catalog, countryname):
    """
    Retorna los videos de un país
    """
    country = model.getVideosByCountry(catalog, countryname)
    return country
예제 #12
0
def getVideosByCountry(catalog, country):
    """
    Retrona los videos de un pais trending
    """
    countryVids = model.getVideosByCountry(catalog, country)
    return countryVids
예제 #13
0
def getVideosByCountry(catalog, country):
    '''
    Retorna los videos dado un país específico
    '''
    return model.getVideosByCountry(catalog, country)