fixed url_import

This commit is contained in:
smilerz
2021-08-14 07:55:22 -05:00
parent 7b4123462d
commit ed49f19fe9
3 changed files with 4 additions and 2 deletions

View File

@ -23,7 +23,8 @@ class Mealie(Integration):
name=recipe_json['name'].strip(), description=description, name=recipe_json['name'].strip(), description=description,
created_by=self.request.user, internal=True, space=self.request.space) created_by=self.request.user, internal=True, space=self.request.space)
# TODO parse times (given in PT2H3M ) # TODO parse times (given in PT2H3M )
# @vabene check recipe_url_import.iso_duration_to_minutes I think it does what you are looking for
ingredients_added = False ingredients_added = False
for s in recipe_json['recipe_instructions']: for s in recipe_json['recipe_instructions']:

View File

@ -25,6 +25,7 @@ class NextcloudCookbook(Integration):
servings=recipe_json['recipeYield'], space=self.request.space) servings=recipe_json['recipeYield'], space=self.request.space)
# TODO parse times (given in PT2H3M ) # TODO parse times (given in PT2H3M )
# @vabene check recipe_url_import.iso_duration_to_minutes I think it does what you are looking for
# TODO parse keywords # TODO parse keywords
ingredients_added = False ingredients_added = False

View File

@ -149,7 +149,7 @@ def import_url(request):
recipe.steps.add(step) recipe.steps.add(step)
for kw in data['keywords']: for kw in data['keywords']:
k = Keyword.objects.get_or_create(name=kw['text'], space=request.space) k, created = Keyword.objects.get_or_create(name=kw['text'], space=request.space)
recipe.keywords.add(k) recipe.keywords.add(k)
for ing in data['recipeIngredient']: for ing in data['recipeIngredient']: