Merge branch 'dev' of https://github.com/hay-kot/mealie into refactor/response-models

This commit is contained in:
hay-kot 2021-02-12 11:44:09 -09:00
commit 228558405e
2 changed files with 6 additions and 1 deletions

View file

@ -28,7 +28,8 @@ def import_recipes(recipe_dir: Path) -> Recipe:
for file in recipe_dir.glob("full.*"):
image = file
recipe_file = recipe_dir.joinpath("recipe.json")
for file in recipe_dir.glob("*.json"):
recipe_file = file
with open(recipe_file, "r") as f:
recipe_dict = json.loads(f.read())
@ -81,6 +82,7 @@ def migrate(session, selection: str):
successful_imports.append(recipe.name)
except:
logging.error(f"Failed Nextcloud Import: {dir.name}")
logging.exception('')
failed_imports.append(dir.name)
cleanup()

View file

@ -35,6 +35,9 @@ def normalize_image_url(image) -> str:
def normalize_instructions(instructions) -> List[dict]:
if not instructions:
return []
# One long string split by (possibly multiple) new lines
if type(instructions) == str:
return [