- +1 minor fix

This commit is contained in:
Dmytro Bogovych 2023-08-22 15:23:09 +03:00
parent 38df4a6209
commit 4bf2282f18
1 changed files with 7 additions and 7 deletions

View File

@ -114,7 +114,7 @@ def upload_results():
# Path to audio # Path to audio
path_audio = t[1] path_audio = t[1]
print(f'Found {path_report.name} and {path_audio.name} files.') utils.log(f'Found {path_report.name} and {path_audio.name} files.')
try: try:
with open(path_report, 'rt') as f: with open(path_report, 'rt') as f:
report = json.loads(f.read()) report = json.loads(f.read())
@ -127,16 +127,16 @@ def upload_results():
utils.log(f'Report {upload_id} is uploaded ok.') utils.log(f'Report {upload_id} is uploaded ok.')
# Rename files to make sync audio filename with reported ones # Rename files to make sync audio filename with reported ones
path_report_fixed = CACHE.dir / f'{upload_id}.json' # path_report_fixed = CACHE.dir / f'{upload_id}.json'
path_report = path_report.rename(path_report_fixed) # path_report = path_report.rename(path_report_fixed)
path_audio_fixed = CACHE.dir / f'{upload_id}.wav' # path_audio_fixed = CACHE.dir / f'{upload_id}.wav'
path_audio = path_audio.rename(path_audio_fixed) # path_audio = path_audio.rename(path_audio_fixed)
utils.log(f'Uploading {path_report.name} and {path_audio.name} files...') utils.log(f'Uploading {path_audio.name} file...')
# Upload recorded audio # Upload recorded audio
upload_result = BackendServer.upload_audio(upload_id, path_audio) upload_result = BackendServer.upload_audio(upload_id, path_audio)
if upload_result: if upload_result:
utils.log('Recorded audio {upload_id}.wav is uploaded ok.') utils.log(' Recorded audio {upload_id}.wav is uploaded ok.')
os.remove(path_report) os.remove(path_report)
os.remove(path_audio) os.remove(path_audio)
else: else: