From e910ec4a51f798273bd8ffa0dd03ad5197a3d9d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:29:14 +0000 Subject: [PATCH 1/4] Bump django from 4.2.15 to 4.2.16 Bumps [django](https://github.com/django/django) from 4.2.15 to 4.2.16. - [Commits](https://github.com/django/django/compare/4.2.15...4.2.16) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 56dbe0ea9..551cb8bc0 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 From 6829d5351d7686ee931352b5463847c2c7225238 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 03:18:39 +0000 Subject: [PATCH 2/4] Bump elliptic from 6.5.4 to 6.5.7 in /vue Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.4 to 6.5.7. - [Commits](https://github.com/indutny/elliptic/compare/v6.5.4...v6.5.7) --- updated-dependencies: - dependency-name: elliptic dependency-type: indirect ... Signed-off-by: dependabot[bot] --- vue/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vue/yarn.lock b/vue/yarn.lock index 9216792c9..b66a81bd5 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" From 736d829bd03e8d82b25fe00baf9ae2f966089b3a Mon Sep 17 00:00:00 2001 From: Chronophylos Date: Sat, 12 Oct 2024 16:01:32 +0200 Subject: [PATCH 3/4] Fix null-constrait errors in mealie import --- cookbook/integration/mealie.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() From 757fa1b7681c5fcba3f45de918fecadf483e4079 Mon Sep 17 00:00:00 2001 From: Thomas Lambertz Date: Sat, 12 Oct 2024 21:15:37 +0200 Subject: [PATCH 4/4] Fix Paprika Import Images when not downloading from URL. Previously, the code only tried to use the cropped image from paprika when downloading actively failed. But if a user takes an image himself, the url will be empty, thus downloading won't be attempted and won't fail. This change makes it so that the download is tried first, but the photo_data is always tried if no image exists for whatever reason. --- cookbook/integration/paprika.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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')