get_best_segments: Don't error if the only segments that exist for time are temp

pull/151/head
Mike Lang 5 years ago
parent 605fedeb52
commit 249e32583b

@ -232,6 +232,9 @@ def best_segments_by_start(hour):
for start_time, segments in itertools.groupby(parsed, key=lambda segment: segment.start): 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 # 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"] 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] full_segments = [segment for segment in segments if not segment.is_partial]
if full_segments: if full_segments:

Loading…
Cancel
Save