mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-15 04:13:11 -05:00
fix: handle numeric recipeCategory from LLM/site to prevent import failure (#7026)
This commit is contained in:
@@ -533,6 +533,9 @@ def clean_categories(category: str | list) -> list[str]:
|
||||
# ]
|
||||
#
|
||||
return [cat["name"] for cat in category if "name" in cat]
|
||||
case int() | float():
|
||||
# Handling for numeric values returned as categories
|
||||
return []
|
||||
case _:
|
||||
raise TypeError(f"Unexpected type for category: {type(category)}, {category}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user