From 066ca27712a327ef3ecfb5c05c2122812e834646 Mon Sep 17 00:00:00 2001 From: smilerz Date: Thu, 20 May 2021 11:57:05 -0500 Subject: [PATCH] updated url import and test due to updated recipe_scraper --- cookbook/helper/recipe_url_import.py | 2 +- cookbook/tests/other/_recipes.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index 7a4de191..73a27fb7 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -46,7 +46,7 @@ def get_from_scraper(scrape, space): servings = int(re.findall(r'\b\d+\b', servings)[0]) except Exception: servings = 1 - recipe_json['servings'] = servings + recipe_json['servings'] = max(servings, 1) try: recipe_json['prepTime'] = get_minutes(scrape.schema.data.get("prepTime")) or 0 diff --git a/cookbook/tests/other/_recipes.py b/cookbook/tests/other/_recipes.py index adcf3bfa..706c88ca 100644 --- a/cookbook/tests/other/_recipes.py +++ b/cookbook/tests/other/_recipes.py @@ -2218,12 +2218,12 @@ TASTE_OF_HOME = { THE_SPRUCE_EATS = { 'file': ['thespruceeats.html'], 'url': 'https://www.thespruceeats.com/creamy-potato-soup-with-ham-3059797', - "name": "", + "name": "Creamy Potato Soup With Ham", "description": "", - "servings": 1, - "prepTime": 0, + "servings": 6, + "prepTime": 55, "cookTime": 0, - "image": "", + "image": 'https://www.thespruceeats.com/thmb/KfpdKXpq4JYKIIyv8ZuKuR8GRkQ=/960x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/creamy-potato-soup-with-ham-3059797-stovetop-step-12-99dc3bf1962c4e26a2d225ee3c25ecad.jpg', "keywords": [], "recipeIngredient": [ {