It's not extremely frequent, but it can happen where the video director forgets to stop recording promptly after scores are posted/announced. In doing so, the recording will have unnecessary post-results content (e.g. B-roll of the venue, sponsor reel) that we don't want to upload. We should perform sanity checking of the length of recordings prior to upload to try and flag any recordings that may need trimming.
We could set some arbitrary number for average match length, but a better way would be to get match timing data from the TBA API. The API response for a given match includes (or at least it should...) data on TBA-estimated start time, schedule-estimated start time, actual start time, and results post time. Using these values, we can estimate how long the recording should be and flag anything that's outside of expectations. We'll need to define expectations, perhaps anything longer than (post_result_time - actual_time) + 30s?
Example API data for a match from 2023gadal:
"actual_time": 1678470914, [Friday, March 10, 2023 5:55:14 PM]
"post_result_time": 1678471115, [Friday, March 10, 2023 5:58:35 PM]
"predicted_time": 1678471064, [Friday, March 10, 2023 5:57:44 PM]
"time": 1678469040, [Friday, March 10, 2023 5:24:00 PM]
It's not extremely frequent, but it can happen where the video director forgets to stop recording promptly after scores are posted/announced. In doing so, the recording will have unnecessary post-results content (e.g. B-roll of the venue, sponsor reel) that we don't want to upload. We should perform sanity checking of the length of recordings prior to upload to try and flag any recordings that may need trimming.
We could set some arbitrary number for average match length, but a better way would be to get match timing data from the TBA API. The API response for a given match includes (or at least it should...) data on TBA-estimated start time, schedule-estimated start time, actual start time, and results post time. Using these values, we can estimate how long the recording should be and flag anything that's outside of expectations. We'll need to define expectations, perhaps anything longer than
(post_result_time - actual_time) + 30s
?Example API data for a match from
2023gadal
: