freelawproject / doctor

A microservice for document conversion at scale
https://free.law/projects/doctor
BSD 2-Clause "Simplified" License
54 stars 14 forks source link

Be lenient in audio metadata we accept #168

Open sentry-io[bot] opened 1 year ago

sentry-io[bot] commented 1 year ago

We do some fun stuff in the set_mp3_meta_data function to make the file better, but in doing so, we make our code fragile. If small pieces of data are missing, we crash and fail to make an mp3. For example, the error below is because we don't have the date argued.

Sentry Issue: DOCTOR-V

KeyError: 'date_argued'
  File "doctor/views.py", line 353, in convert_audio
    set_mp3_meta_data(audio_data, filepath)
  File "doctor/tasks.py", line 496, in set_mp3_meta_data
    date_argued = audio_data["date_argued"]

Lame.