mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-08 08:53:10 -05:00
refactor/recipe-to-snake-case (#364)
* formatting * snake case all recipes entries * set foreign key to int * run scheduler at startup and not import * set SQLite file path before imports Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
@@ -83,7 +83,7 @@ class ImportDatabase:
|
||||
del recipe_dict["categories"]
|
||||
try:
|
||||
del recipe_dict["_id"]
|
||||
del recipe_dict["dateAdded"]
|
||||
del recipe_dict["date_added"]
|
||||
except:
|
||||
pass
|
||||
# Migration from list to Object Type Data
|
||||
|
||||
@@ -144,7 +144,7 @@ class MigrationBase(BaseModel):
|
||||
"""Calls the rewrite_alias function and the Cleaner.clean function on a
|
||||
dictionary and returns the result unpacked into a Recipe object"""
|
||||
recipe_dict = self.rewrite_alias(recipe_dict)
|
||||
recipe_dict = Cleaner.clean(recipe_dict, url=recipe_dict.get("orgURL", None))
|
||||
recipe_dict = Cleaner.clean(recipe_dict, url=recipe_dict.get("org_url", None))
|
||||
|
||||
return Recipe(**recipe_dict)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class NextcloudDir:
|
||||
class NextcloudMigration(MigrationBase):
|
||||
key_aliases: Optional[list[MigrationAlias]] = [
|
||||
MigrationAlias(key="tags", alias="keywords", func=helpers.split_by_comma),
|
||||
MigrationAlias(key="orgURL", alias="url", func=None),
|
||||
MigrationAlias(key="org_url", alias="url", func=None),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user