From b9040cb3a4f700c79fa6034c2b6c2ec718542a7d Mon Sep 17 00:00:00 2001 From: its_me_gb Date: Wed, 28 Apr 2021 18:41:26 +0100 Subject: [PATCH] parse the servings --- cookbook/integration/recettetek.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cookbook/integration/recettetek.py b/cookbook/integration/recettetek.py index 778cf66c2..bf3482851 100644 --- a/cookbook/integration/recettetek.py +++ b/cookbook/integration/recettetek.py @@ -57,9 +57,13 @@ class RecetteTek(Integration): recipe.steps.add(step) # Attempt to import prep/cooking times + # quick hack, this assumes only one number in the quantity field. try: if file['quantity'] != '': - recipe.servings = int(file['quantity']) + for item in file['quantity'].split(' '): + if item.isdigit(): + recipe.servings = int(item) + break except Exception as e: print(recipe.name, ': failed to parse quantity ', str(e))