diff --git a/mealie/services/recipe_services.py b/mealie/services/recipe_services.py index 83bfb490b..fbaa80003 100644 --- a/mealie/services/recipe_services.py +++ b/mealie/services/recipe_services.py @@ -67,9 +67,7 @@ class Recipe(BaseModel): "notes": [{"title": "Watch Out!", "text": "Prep the day before!"}], "orgURL": "https://www.bonappetit.com/recipe/chicken-and-rice-with-leeks-and-salsa-verde", "rating": 3, - "extras": { - "message": "Don't forget to defrost the chicken!" - } + "extras": {"message": "Don't forget to defrost the chicken!"}, } } @@ -152,6 +150,13 @@ class Recipe(BaseModel): document.update(set__extras=self.extras) document.save() + @staticmethod + def update_image(slug: str, extension: str): + document = RecipeDocument.objects.get(slug=slug) + + if document: + document.update(set__image=f"{slug}.{extension}") + def read_requested_values(keys: list, max_results: int = 0) -> List[dict]: """