visiual AI import improvements

This commit is contained in:
vabene1111
2025-04-02 19:18:01 +02:00
parent e0c8895733
commit 431eb7baf7
2 changed files with 17 additions and 4 deletions

View File

@@ -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)