From f876d1ea3dda70715723ff5c693491e4a33dda5f Mon Sep 17 00:00:00 2001 From: Joey Date: Sat, 30 Sep 2023 20:22:00 -0400 Subject: [PATCH] Update hellofresh.py Removed "return 0" and implemented recommended adjustments. --- recipe_scrapers/hellofresh.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe_scrapers/hellofresh.py b/recipe_scrapers/hellofresh.py index 7bac7b078..d83686462 100644 --- a/recipe_scrapers/hellofresh.py +++ b/recipe_scrapers/hellofresh.py @@ -21,7 +21,6 @@ def cook_time(self): if total_time_match: total_time_str = total_time_match.group(1) return get_minutes(total_time_str) - return 0 def prep_time(self): script_tag = self.soup.find("script", {"id": "__NEXT_DATA__"}) @@ -31,12 +30,13 @@ def prep_time(self): if prep_time_match: prep_time_str = prep_time_match.group(1) return get_minutes(prep_time_str) - return 0 # Note: HelloFresh uses the 'totalTime' metadata field to represent only the cook time. # To get the actual total time, the 'prepTime' and 'totalTime' (which is the cook time) need to be added. def total_time(self): - return self.cook_time() + self.prep_time() + prep_time, cook_time = self.prep_time(), self.cook_time() + if prep_time or cook_time: + return (prep_time or 0) + (cook_time or 0) def yields(self): return self.schema.yields()