- handle uploading of non-existent recorded audio file
This commit is contained in:
parent
c4aead0300
commit
b3f87c97f0
|
|
@ -106,15 +106,17 @@ def upload_results():
|
|||
|
||||
# path_audio_fixed = CACHE.dir / f'{upload_id}.wav'
|
||||
# path_audio = path_audio.rename(path_audio_fixed)
|
||||
if path_audio.exists():
|
||||
utils.log(f'Uploading {path_audio.name} file...')
|
||||
# Upload recorded audio
|
||||
upload_result = BACKEND.upload_audio(upload_id, path_audio)
|
||||
if upload_result:
|
||||
utils.log(f' Recorded audio {upload_id}.wav is uploaded ok.')
|
||||
os.remove(path_report)
|
||||
os.remove(path_audio)
|
||||
else:
|
||||
break
|
||||
utils.log(f'No recorded audio file found, skipping audio upload.')
|
||||
os.remove(path_report)
|
||||
|
||||
else:
|
||||
utils.log(f'Failed to upload report {path_report.name}')
|
||||
break
|
||||
|
|
|
|||
Loading…
Reference in New Issue