def view_transform_profiles_add(request): u"""Add a transformation profile.""" try: data = get_request_data(request, qs_only_first_value=True) profile = TransformProfile(title=data[u'title'], description=data[u'description'], encoder_name=data[u'encoder_name'], encoder_string=data[u'encoder_string']) api_core.save_transform_profile(profile) return {u'infos': [u"Profile '{0}' was created successfully.".format(profile.title)]} except Exception as e: logging.exception(e) return {u'errors': [unicode(e)]}
def api_transform_profile_post(auth_user=None, api_core=None, request=None): u""" Add a transformation profile. The transformation profile's ``encoder_name`` attribute can be the following : * **copy** to bypass FFmpeg and do a simple file block copy ; * **ffmpeg** to transcode a media asset to another with FFMpeg ; * **dashcast** to transcode a media asset to MPEG-DASH with DashCast ; """ data = get_request_data(request, qs_only_first_value=True) profile = TransformProfile(title=data[u'title'], description=data[u'description'], encoder_name=data[u'encoder_name'], encoder_string=data[u'encoder_string']) api_core.save_transform_profile(profile) return ok_200(profile, include_properties=True)