diff --git a/cookbook/integration/mealie.py b/cookbook/integration/mealie.py index 21ff633c5..f8c2f2423 100644 --- a/cookbook/integration/mealie.py +++ b/cookbook/integration/mealie.py @@ -72,14 +72,14 @@ class Mealie(Integration): ) recipe.steps.add(step) - if 'recipe_yield' in recipe_json: + if 'recipe_yield' in recipe_json and recipe_json['recipe_yield'] is not None: recipe.servings = parse_servings(recipe_json['recipe_yield']) recipe.servings_text = parse_servings_text(recipe_json['recipe_yield']) if 'total_time' in recipe_json and recipe_json['total_time'] is not None: recipe.working_time = parse_time(recipe_json['total_time']) - if 'org_url' in recipe_json: + if 'org_url' in recipe_json and recipe_json['org_url'] is not None: recipe.source_url = recipe_json['org_url'] recipe.save() diff --git a/cookbook/integration/paprika.py b/cookbook/integration/paprika.py index 20c3d153b..227ef4539 100644 --- a/cookbook/integration/paprika.py +++ b/cookbook/integration/paprika.py @@ -84,6 +84,11 @@ class Paprika(Integration): recipe.steps.add(step) + # Paprika exports can have images in either of image_url, or photo_data. + # If a user takes an image himself, only photo_data will be set. + # If a user imports an image, both will be set. But the photo_data will be a center-cropped square resized version, so the image_url is preferred. + + # Try to download image if possible try: if recipe_json.get("image_url", None): url = recipe_json.get("image_url", None) @@ -91,6 +96,10 @@ class Paprika(Integration): response = requests.get(url) self.import_recipe_image(recipe, BytesIO(response.content)) except Exception: + pass + + # If no image downloaded, try to extract from photo_data + if not recipe.image: if recipe_json.get("photo_data", None): self.import_recipe_image(recipe, BytesIO(base64.b64decode(recipe_json['photo_data'])), filetype='.jpeg') diff --git a/requirements.txt b/requirements.txt index d3dd3ad75..f887e95de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==4.2.15 +Django==4.2.16 cryptography===43.0.1 django-annoying==0.10.6 django-cleanup==8.0.0 diff --git a/vue/yarn.lock b/vue/yarn.lock index 0925aa19d..dad3efaea 100644 --- a/vue/yarn.lock +++ b/vue/yarn.lock @@ -5185,9 +5185,9 @@ electron-to-chromium@^1.4.477: integrity sha512-VTq6vjk3kCfG2qdzQRd/i9dIyVVm0dbtZIgFzrLgfB73mXDQT2HPKVRc1EoZcAVUv9XhXAu08DWqJuababdGGg== elliptic@^6.5.3, elliptic@^6.5.4: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + version "6.5.7" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" + integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== dependencies: bn.js "^4.11.9" brorand "^1.1.0"