mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-07 08:23:12 -05:00
Fix/fix slug names (#1026)
* fix food seeder to use value instead of keys * fix all recipe names being slugified * add helper path utilities * add fix script for database to rename foods * add safe calling for fixes
This commit is contained in:
@@ -42,14 +42,14 @@ def create_from_url(url: str) -> Recipe:
|
||||
|
||||
try:
|
||||
recipe_data_service.scrape_image(new_recipe.image)
|
||||
new_recipe.name = slugify(new_recipe.name)
|
||||
new_recipe.slug = slugify(new_recipe.name)
|
||||
new_recipe.image = cache.new_key(4)
|
||||
except Exception as e:
|
||||
recipe_data_service.logger.exception(f"Error Scraping Image: {e}")
|
||||
new_recipe.image = "no image"
|
||||
|
||||
if new_recipe.name is None or new_recipe.name == "":
|
||||
new_recipe.name = "No Recipe Name Found - " + str(uuid4())
|
||||
new_recipe.name = f"No Recipe Name Found - {str(uuid4())}"
|
||||
new_recipe.slug = slugify(new_recipe.name)
|
||||
|
||||
return new_recipe
|
||||
|
||||
Reference in New Issue
Block a user