def process_recorded_file_helper (user, request, filename, submityn): newfilename = convertaudio.convert_uploaded_file(filename) #TODO: For now it's easiest to call these three functions because they already #exist, but in the long term, it'll be more efficient to just create one row in the #database instead of creating, and updating it twice like I'm doing here. if newfilename: recordingid = db.store_recording(user, request, newfilename) discover_audiolength.discover_and_set_audiolength(recordingid, newfilename) if submityn == 'Y': db.submit_recording(recordingid) return recordingid else: raise RoundException("File not converted successfully: " + newfilename)
def enter_recording (form): response = {} logging.debug("enter_recording") db.log_event(7, form) user = form_to_user(form) request = form_to_recording_request(form) recordingid = db.store_recording(user, request, '') response['RESULT'] = recordingid msg = db.get_sharing_message_for_categoryid(form['categoryid']) msg = msg + str(recordingid) response['SHARING_MESSAGE'] = msg return response