def handle(self, *args, **options): queue = self.get_podcasts(*args, **options) max_podcasts = options.get("max") if max_podcasts: queue = islice(queue, 0, max_podcasts) if options.get("list"): for podcast in queue: logger.info("Podcast %s", podcast) else: logger.info("Updating podcasts...") updater = PodcastUpdater() for podcast in updater.update_queue(queue): logger.info("Updated podcast %s", podcast)
def handle(self, *args, **options): queue = self.get_podcasts(*args, **options) max_podcasts = options.get('max') if max_podcasts: queue = islice(queue, 0, max_podcasts) if options.get('list'): for podcast in queue: logger.info('Podcast %s', podcast) else: logger.info('Updating podcasts...') updater = PodcastUpdater() for podcast in updater.update_queue(queue): logger.info('Updated podcast %s', podcast)
def update_podcasts(podcast_urls): """ Task to update a podcast """ from mygpo.data.feeddownloader import PodcastUpdater updater = PodcastUpdater() podcasts = updater.update_queue(podcast_urls) return list(podcasts)
def update_podcasts(podcast_urls): """ Task to update a podcast """ updater = PodcastUpdater() podcasts = updater.update_queue(podcast_urls) return list(podcasts)