feat: Optionally include URL when importing via HTML/JSON (#6709)

This commit is contained in:
Michael Genson
2025-12-12 23:20:26 -06:00
committed by GitHub
parent 24c111af7b
commit 20a6e71b31
10 changed files with 43 additions and 15 deletions

View File

@@ -148,7 +148,7 @@ class RecipeController(BaseRecipeController):
async def _create_recipe_from_web(self, req: ScrapeRecipe | ScrapeRecipeData):
if isinstance(req, ScrapeRecipeData):
html = req.data
url = ""
url = req.url or ""
else:
html = None
url = req.url

View File

@@ -27,3 +27,6 @@ class ScrapeRecipe(ScrapeRecipeBase):
class ScrapeRecipeData(ScrapeRecipeBase):
data: str
"""HTML data or JSON string of a https://schema.org/Recipe object"""
url: str | None = None
"""Optional URL of the recipe source"""