Skip to content

feat: Add new migration for DVO Cook'n #5085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: mealie-next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docs/documentation/getting-started/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Mealie supports importing recipes from a few other sources besides websites. Cur
- Recipe Keeper
- Copy Me That
- My Recipe Box
- DVO Cook'n X3

You can access these options on your installation at the `/group/migrations` page on your installation. If you'd like to see another source added, feel free to request so on Github.

Expand Down
1 change: 1 addition & 0 deletions docs/docs/documentation/getting-started/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Mealie is a self hosted recipe manager and meal planner with a RestAPI backend a
- Copy Me That
- Paprika
- Tandoor Recipes
- DVO Cook'n X3
- Random Meal Plan generation
- Advanced rule configuration to fine tune random recipes

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/overrides/api.html

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions frontend/lang/messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@
"description-long": "Mealie can import recipes from Tandoor. Export your data in the \"Default\" format, then upload the .zip below.",
"title": "Tandoor Recipes"
},
"cookn": {
"description-long": "Mealie can import recipes from DVO Cook'n X3. Export a cookbook or menu in the \"Cook'n\" format, rename the export extension to .zip, then upload the .zip below.",
"title": "DVO Cook'n X3"
},
"recipe-data-migrations": "Recipe Data Migrations",
"recipe-data-migrations-explanation": "Recipes can be migrated from another supported application to Mealie. This is a great way to get started with Mealie.",
"coming-from-another-application-or-an-even-older-version-of-mealie": "Coming from another application or an even older version of Mealie? Check out migrations and see if your data can be imported.",
Expand Down
3 changes: 2 additions & 1 deletion frontend/lib/api/types/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export type SupportedMigrations =
| "tandoor"
| "plantoeat"
| "myrecipebox"
| "recipekeeper";
| "recipekeeper"
| "cookn";

export interface CreateGroupPreferences {
privateGroup?: boolean;
Expand Down
34 changes: 34 additions & 0 deletions frontend/pages/group/migrations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const MIGRATIONS = {
plantoeat: "plantoeat",
recipekeeper: "recipekeeper",
tandoor: "tandoor",
cookn: "cookn"
};

export default defineComponent({
Expand Down Expand Up @@ -140,6 +141,10 @@ export default defineComponent({
text: i18n.tc("migration.tandoor.title"),
value: MIGRATIONS.tandoor,
},
{
text: i18n.tc("migration.cookn.title"),
value: MIGRATIONS.cookn,
},
];
const _content = {
[MIGRATIONS.mealie]: {
Expand Down Expand Up @@ -372,6 +377,35 @@ export default defineComponent({
}
],
},
[MIGRATIONS.cookn]: {
text: i18n.tc("migration.cookn.description-long"),
acceptedFileType: ".zip",
tree: [
{
id: 1,
icon: $globals.icons.zip,
name: "cookn.zip",
children: [
{ id: 2, name: "temp_brand.dsv", icon: $globals.icons.codeJson },
{ id: 3, name: "temp_chapter_desc.dsv", icon: $globals.icons.codeJson },
{ id: 4, name: "temp_chapter.dsv", icon: $globals.icons.codeJson },
{ id: 5, name: "temp_cookBook_desc.dsv", icon: $globals.icons.codeJson },
{ id: 6, name: "temp_cookBook.dsv", icon: $globals.icons.codeJson },
{ id: 7, name: "temp_food_brand.dsv", icon: $globals.icons.codeJson },
{ id: 8, name: "temp_food_group.dsv", icon: $globals.icons.codeJson },
{ id: 9, name: "temp_food.dsv", icon: $globals.icons.codeJson },
{ id: 10, name: "temp_ingrediant.dsv", icon: $globals.icons.codeJson },
{ id: 11, name: "temp_media.dsv", icon: $globals.icons.codeJson },
{ id: 12, name: "temp_nutrient.dsv", icon: $globals.icons.codeJson },
{ id: 13, name: "temp_recipe_desc.dsv", icon: $globals.icons.codeJson },
{ id: 13, name: "temp_recipe.dsv", icon: $globals.icons.codeJson },
{ id: 13, name: "temp_unit_equivalent.dsv", icon: $globals.icons.codeJson },
{ id: 13, name: "temp_unit.dsv", icon: $globals.icons.codeJson },
{ id: 13, name: "images", icon: $globals.icons.fileImage },
]
}
],
},
};

function setFileObject(fileObject: File) {
Expand Down
2 changes: 2 additions & 0 deletions mealie/routes/groups/controller_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from mealie.services.migrations import (
BaseMigrator,
ChowdownMigrator,
CooknMigrator,
CopyMeThatMigrator,
MealieAlphaMigrator,
MyRecipeBoxMigrator,
Expand Down Expand Up @@ -59,6 +60,7 @@ def start_data_migration(
SupportedMigrations.plantoeat: PlanToEatMigrator,
SupportedMigrations.myrecipebox: MyRecipeBoxMigrator,
SupportedMigrations.recipekeeper: RecipeKeeperMigrator,
SupportedMigrations.cookn: CooknMigrator,
}

constructor = table.get(migration_type, None)
Expand Down
1 change: 1 addition & 0 deletions mealie/schema/group/group_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SupportedMigrations(str, enum.Enum):
plantoeat = "plantoeat"
myrecipebox = "myrecipebox"
recipekeeper = "recipekeeper"
cookn = "cookn"


class DataMigrationCreate(MealieModel):
Expand Down
1 change: 1 addition & 0 deletions mealie/services/migrations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .chowdown import *
from .cookn import *
from .copymethat import *
from .mealie_alpha import *
from .myrecipebox import *
Expand Down
Loading