(self, request, username)
return JsonResponse({"update_url": update_urls, "timestamp": now_})
Add / remove Chapters to/from an episode
Add / remove Chapters to/from an episode
Add / remove Chapters to / from an episode
def post(self, request, username):
        """Add / remove Chapters to/from an episode"""
        user = request.user
        now_ = get_timestamp(datetime.utcnow())

        body = self.parsed_body(request)

        podcast_url, episode_url, update_urls = self.get_urls(body)
        body["podcast"] = podcast_url
        body["episode"] = episode_url

        if not podcast_url or not episode_url:
            raise RequestException("Invalid Podcast or Episode URL")

        self.update_chapters(body, user)
        return JsonResponse({"update_url": update_urls, "timestamp": now_})
def post ( self , request , username ) : user = request . user now_ = get_timestamp ( datetime . utcnow ( ) ) body = self . parsed_body ( request ) podcast_url , episode_url , update_urls = self . get_urls ( body ) body [ "podcast" ] = podcast_url body [ "episode" ] = episode_url if not podcast_url or not episode_url : raise RequestException ( "Invalid Podcast or Episode URL" ) self . update_chapters ( body , user ) return JsonResponse ( { "update_url" : update_urls , "timestamp" : now_ } )