fixed url import servings
This commit is contained in:
@ -45,12 +45,7 @@ def get_from_scraper(scrape, request):
|
|||||||
recipe_json['internal'] = True
|
recipe_json['internal'] = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
servings = scrape.yields() or None
|
servings = scrape.schema.data.get('recipeYield') or 1 # dont use scrape.yields() as this will always return "x servings" or "x items", should be improved in scrapers directly
|
||||||
except Exception:
|
|
||||||
servings = None
|
|
||||||
if not servings:
|
|
||||||
try:
|
|
||||||
servings = scrape.schema.data.get('recipeYield') or 1
|
|
||||||
except Exception:
|
except Exception:
|
||||||
servings = 1
|
servings = 1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user