Merge branch 'testing' of https://github.com/bbilly1/tubearchivist into feat/react-frontend

This commit is contained in:
Sean Norwood 2022-04-14 19:45:23 +00:00
commit d305c94989
2 changed files with 6 additions and 1 deletions

View File

@ -133,7 +133,7 @@ class Pagination:
"""validate pagination with total_hits after making api call""" """validate pagination with total_hits after making api call"""
page_get = self.page_get page_get = self.page_get
max_pages = math.ceil(total_hits / self.page_size) max_pages = math.ceil(total_hits / self.page_size)
if total_hits > 10000: if total_hits >= 10000:
# es returns maximal 10000 results # es returns maximal 10000 results
self.pagination["max_hits"] = True self.pagination["max_hits"] = True
max_pages = max_pages - 1 max_pages = max_pages - 1

View File

@ -170,6 +170,11 @@ class SubtitleParser:
self.all_cues = [] self.all_cues = []
for idx, event in enumerate(all_events): for idx, event in enumerate(all_events):
if "dDurationMs" not in event:
# some events won't have a duration
print(f"failed to parse event without duration: {event}")
continue
cue = { cue = {
"start": self._ms_conv(event["tStartMs"]), "start": self._ms_conv(event["tStartMs"]),
"end": self._ms_conv(event["tStartMs"] + event["dDurationMs"]), "end": self._ms_conv(event["tStartMs"] + event["dDurationMs"]),