Fix bug in qualifier parsing

This commit is contained in:
Dallin Miner 2025-02-21 04:28:58 +00:00 committed by Dallin Miner
commit 78142918c5

View file

@ -223,7 +223,7 @@ class CooknMigrator(BaseMigrator):
note += ", " note += ", "
if post_qualifier[-1] == ",": if post_qualifier[-1] == ",":
post_qualifier = post_qualifier[:-1] post_qualifier = post_qualifier[:-1]
if pre_qualifier[0] == ",": if post_qualifier[0] == ",":
post_qualifier = post_qualifier[1:].lstrip() post_qualifier = post_qualifier[1:].lstrip()
note += post_qualifier note += post_qualifier
@ -255,7 +255,7 @@ class CooknMigrator(BaseMigrator):
lines = instructions.splitlines() lines = instructions.splitlines()
steps = [] steps = []
current_step = [] current_step: list[str] = []
for line in lines: for line in lines:
line = line.strip() line = line.strip()
@ -294,7 +294,7 @@ class CooknMigrator(BaseMigrator):
def _process_recipe_document(self, _recipe_row, db) -> dict: def _process_recipe_document(self, _recipe_row, db) -> dict:
"""Parses recipe row from the Cook'n recipe table.""" """Parses recipe row from the Cook'n recipe table."""
recipe_data = {} recipe_data: dict[str, str | list[str | RecipeIngredient]] = {}
# Select db values # Select db values
_recipe_id = db.get_data(_recipe_row, "ID") _recipe_id = db.get_data(_recipe_row, "ID")