From 249e32583bf4d4640eb851e702db91aa61db2699 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Wed, 6 Nov 2019 06:40:17 -0800 Subject: [PATCH] get_best_segments: Don't error if the only segments that exist for time are temp --- common/common/segments.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/common/segments.py b/common/common/segments.py index 34283ae..8dff627 100644 --- a/common/common/segments.py +++ b/common/common/segments.py @@ -232,6 +232,9 @@ def best_segments_by_start(hour): for start_time, segments in itertools.groupby(parsed, key=lambda segment: segment.start): # ignore temp segments as they might go away by the time we want to use them segments = [segment for segment in segments if segment.type != "temp"] + if not segments: + # all segments were temp, move on + continue full_segments = [segment for segment in segments if not segment.is_partial] if full_segments: