From 431eb7baf750e724c74afbcf35d6f1d0da158b56 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 2 Apr 2025 19:18:01 +0200 Subject: [PATCH] visiual AI import improvements --- cookbook/views/api.py | 6 +++++- vue3/src/pages/RecipeImportPage.vue | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/cookbook/views/api.py b/cookbook/views/api.py index b5895c6de..2e11913a6 100644 --- a/cookbook/views/api.py +++ b/cookbook/views/api.py @@ -1869,8 +1869,12 @@ class ImageToRecipeView(APIView): scrape = scrape_html(html=data, org_url='https://urlnotfound.none', supported_only=False) if scrape: + recipe = helper.get_from_scraper(scrape, request) + obj, created = Keyword.objects.get_or_create(name='✨ AI', space=request.space) + recipe['keywords'].append({'label': obj.name, 'name': obj.name, 'id': obj.id, 'import_keyword': True}) + response = {} - response['recipe'] = helper.get_from_scraper(scrape, request) + response['recipe'] = recipe response['images'] = [] response['duplicates'] = [] return Response(RecipeFromSourceResponseSerializer(context={'request': request}).to_representation(response), status=status.HTTP_200_OK) diff --git a/vue3/src/pages/RecipeImportPage.vue b/vue3/src/pages/RecipeImportPage.vue index 5c0699320..e7fae4899 100644 --- a/vue3/src/pages/RecipeImportPage.vue +++ b/vue3/src/pages/RecipeImportPage.vue @@ -118,7 +118,13 @@ - + + + @@ -365,11 +371,11 @@ - + - +