mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
redirect to import url for processing
This commit is contained in:
@@ -118,7 +118,7 @@ def get_recipe_from_source(text, url, space):
|
||||
temp_tree.append(node)
|
||||
|
||||
if '@type' in el and el['@type'] == 'Recipe':
|
||||
recipe_json = helper.find_recipe_json(el, None, space)
|
||||
recipe_json = helper.find_recipe_json(el, url, space)
|
||||
recipe_tree += [{'name': 'ld+json', 'children': temp_tree}]
|
||||
else:
|
||||
recipe_tree += [{'name': 'json', 'children': temp_tree}]
|
||||
|
||||
@@ -86,6 +86,9 @@ def find_recipe_json(ld_json, url, space):
|
||||
else:
|
||||
ld_json['recipeInstructions'] = ""
|
||||
|
||||
if url:
|
||||
ld_json['recipeInstructions'] += "\nImported from " + url
|
||||
|
||||
if 'image' in ld_json:
|
||||
ld_json['image'] = parse_image(ld_json['image'])
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user