This commit is contained in:
hay-kot 2021-03-09 19:42:45 -09:00
commit 9d34d48a24

View file

@ -48,7 +48,6 @@ class Cleaner:
recipe_data["slug"] = slugify(recipe_data.get("name")) recipe_data["slug"] = slugify(recipe_data.get("name"))
recipe_data["orgURL"] = url recipe_data["orgURL"] = url
print(recipe_data["recipeIngredient"])
return recipe_data return recipe_data
@ -84,7 +83,7 @@ class Cleaner:
return [] return []
# One long string split by (possibly multiple) new lines # One long string split by (possibly multiple) new lines
if type(instructions) == str: if isinstance(instructions, str):
return [ return [
{"text": Cleaner._instruction(line)} {"text": Cleaner._instruction(line)}
for line in instructions.splitlines() for line in instructions.splitlines()
@ -111,7 +110,7 @@ class Cleaner:
sectionSteps = [] sectionSteps = []
for step in instructions: for step in instructions:
if step["@type"] == "HowToSection": if step["@type"] == "HowToSection":
[sectionSteps.append(item) for item in step["itemListELement"]] [sectionSteps.append(item) for item in step["itemListElement"]]
if len(sectionSteps) > 0: if len(sectionSteps) > 0:
return [ return [