From 820c9b704f0a92485e604b46097b96d07aadfe89 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 11 Feb 2023 09:04:05 +0100 Subject: [PATCH] improved servings parser --- cookbook/helper/recipe_url_import.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index 93a9b7c32..3024c7e3a 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -322,6 +322,11 @@ def parse_servings_text(servings): servings = re.sub("\d+", '', servings).strip() except Exception: servings = '' + if type(servings) == list: + try: + servings = parse_servings_text(servings[1]) + except Exception: + pass return str(servings)[:32]