Пример #1
0
    def get(self, podcastId):
        """Get a podcast by id."""
        args = podcast_parser.parse_args()
        fetch = args.get("fetch")
        max_episodes = args.get("maxEpisodes")
        podcastId = urllib.unquote(podcastId)
        if fetch:
            podcast = Podcast.get_or_fetch(podcastId,
                                           max_episodes=max_episodes)
        else:
            podcast = Podcast.get_by_url(podcastId, max_episodes=max_episodes)

        if podcast == None:
            abort(404, message="Podcast not found: %s" % podcastId)
        podcast.ensure_episode_images()
        return podcast
Пример #2
0
 def get(self, podcastId):
     args = episode_parser.parse_args()
     return Podcast.get_episodes(podcastId, args.get("perPage"),
                                 args.get("page"))
Пример #3
0
 def get(self):
     """Query for podcasts."""
     args = query_parser.parse_args()
     return Podcast.query(**args)