From cc62b088fd40edd8a6068961258fd0d997a0fdc4 Mon Sep 17 00:00:00 2001 From: smilerz Date: Wed, 24 Feb 2021 17:52:40 -0600 Subject: [PATCH] fix URL import when recipeYield is a list --- cookbook/helper/recipe_url_import.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index 0ff4f1c9f..139b20ab2 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -222,6 +222,8 @@ def find_recipe_json(ld_json, url): if 'recipeYield' in ld_json: if type(ld_json['recipeYield']) == str: ld_json['servings'] = int(re.findall(r'\b\d+\b', ld_json['recipeYield'])[0]) + elif type(ld_json['recipeYield']) == list: + ld_json['servings'] = int(re.findall(r'\b\d+\b', ld_json['recipeYield'][0])[0]) except Exception as e: print(e) ld_json['servings'] = 1