From 745c045f06624fe725f905840e83375b8be0534d Mon Sep 17 00:00:00 2001 From: smilerz Date: Thu, 30 Nov 2023 16:24:24 -0600 Subject: [PATCH] truncated long description --- cookbook/helper/recipe_url_import.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index b863e8bdb..d1ef1b98f 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -163,10 +163,9 @@ def get_from_scraper(scrape, request): if len(recipe_json['steps']) == 0: recipe_json['steps'].append({'instruction': '', 'ingredients': [], }) + recipe_json['description'] = recipe_json['description'][:512] if len(recipe_json['description']) > 256: # split at 256 as long descriptions don't look good on recipe cards recipe_json['steps'][0]['instruction'] = f"*{recipe_json['description']}* \n\n" + recipe_json['steps'][0]['instruction'] - else: - recipe_json['description'] = recipe_json['description'][:512] try: for x in scrape.ingredients():