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
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
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
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
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
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
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
def getVideosByCountry(catalog, country): return model.getVideosByCountry(catalog, country)
def getVideosByCountry(catalog, country): """ Retorna los videos dado un pais """ videos = model.getVideosByCountry(catalog, country) return videos
def getVideosCountry(catalog, country, category): videos = model.getVideosByCountry(catalog, country, category) return videos
def getVideosByCountry(catalog, countryname): """ Retorna los videos de un país """ country = model.getVideosByCountry(catalog, countryname) return country
def getVideosByCountry(catalog, country): """ Retrona los videos de un pais trending """ countryVids = model.getVideosByCountry(catalog, country) return countryVids
def getVideosByCountry(catalog, country): ''' Retorna los videos dado un país específico ''' return model.getVideosByCountry(catalog, country)