@login_required
def rename_transcripts(request):
 response = {'status': 'Error', 'subs': ''}
 try:
  (__, videos, item) = _validate_transcripts_data(request)
 except TranscriptsRequestValidationException as e:
  return error_response(response, e.message)
 old_name = item.sub
 for new_name in videos['html5'].keys():
  try:
   copy_or_rename_transcript(new_name, old_name, item, user=request.user)
  except NotFoundError:
   error_response(response, "Can't find transcripts in storage for {}".format(old_name))
 response['status'] = 'Success'
 response['subs'] = item.sub
 log.debug('Updated item.sub to %s', item.sub)
 return JsonResponse(response)

@ login_required def rename_transcripts ( request ) : response = { 'status' : 'Error' , 'subs' : '' } try : ( __ , videos , item ) = _validate_transcripts_data ( request ) except TranscriptsRequestValidationException as e : return error_response ( response , e . message ) old_name = item . sub for new_name in videos [ 'html5' ] . keys ( ) : try : copy_or_rename_transcript ( new_name , old_name , item , user = request . user ) except NotFoundError : error_response ( response , "Can't find transcripts in storage for {}" . format ( old_name ) ) response [ 'status' ] = 'Success' response [ 'subs' ] = item . sub log . debug ( 'Updated item.sub to %s' , item . sub ) return JsonResponse ( response )
create copies of existing subtitles with new names of html5 sources .