mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-16 12:53: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:
0
mealie/repos/seed/resources/__init__.py
Normal file
0
mealie/repos/seed/resources/__init__.py
Normal file
5
mealie/repos/seed/resources/foods/__init__.py
Normal file
5
mealie/repos/seed/resources/foods/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from pathlib import Path
|
||||
|
||||
CWD = Path(__file__).parent
|
||||
|
||||
en_us = CWD / "en-us.json"
|
||||
5
mealie/repos/seed/resources/labels/__init__.py
Normal file
5
mealie/repos/seed/resources/labels/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from pathlib import Path
|
||||
|
||||
CWD = Path(__file__).parent
|
||||
|
||||
en_us = CWD / "en-us.json"
|
||||
5
mealie/repos/seed/resources/units/__init__.py
Normal file
5
mealie/repos/seed/resources/units/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from pathlib import Path
|
||||
|
||||
CWD = Path(__file__).parent
|
||||
|
||||
en_us = CWD / "en-us.json"
|
||||
@@ -49,7 +49,8 @@ class IngredientUnitsSeeder(AbstractSeeder):
|
||||
class IngredientFoodsSeeder(AbstractSeeder):
|
||||
def load_data(self) -> Generator[SaveIngredientFood, None, None]:
|
||||
file = self.resources / "foods" / "en-us.json"
|
||||
for food in json.loads(file.read_text()):
|
||||
foods: dict[str, str] = json.loads(file.read_text())
|
||||
for food in foods.values():
|
||||
yield SaveIngredientFood(
|
||||
group_id=self.group_id,
|
||||
name=food,
|
||||
|
||||
Reference in New Issue
Block a user