IMDb import: fix assertion

We should only assert where we know the result, here the input file
could just as well be empty.
This commit is contained in:
ducklet 2023-02-04 13:18:46 +01:00
parent 69643455a6
commit 7a7d619e64

View file

@ -198,7 +198,9 @@ async def import_from_file(*, basics_path: Path, ratings_path: Path):
log.info("💾 Importing movies ...")
total = count_lines(basics_path)
assert total != 0
log.debug("Found %i movies.", total)
if total == 0:
raise RuntimeError(f"No movies found.")
perc_next_report = 0.0
perc_step = 0.1