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

Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
Dallin Miner
2025-10-09 23:22:51 -06:00
committed by GitHub
parent a95eaf3d2e
commit 71d86489f4
15 changed files with 493 additions and 21 deletions

View File

@@ -399,6 +399,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.",

View File

@@ -14,7 +14,8 @@ export type SupportedMigrations =
| "tandoor"
| "plantoeat"
| "myrecipebox"
| "recipekeeper";
| "recipekeeper"
| "cookn";
export interface CreateGroupPreferences {
privateGroup?: boolean;

View File

@@ -124,6 +124,7 @@ const MIGRATIONS = {
plantoeat: "plantoeat",
recipekeeper: "recipekeeper",
tandoor: "tandoor",
cookn: "cookn",
};
export default defineNuxtComponent({
@@ -185,6 +186,10 @@ export default defineNuxtComponent({
text: i18n.t("migration.tandoor.title"),
value: MIGRATIONS.tandoor,
},
{
text: i18n.t("migration.cookn.title"),
value: MIGRATIONS.cookn,
},
];
const _content: Record<string, MigrationContent> = {
[MIGRATIONS.mealie]: {
@@ -398,6 +403,34 @@ export default defineNuxtComponent({
},
],
},
[MIGRATIONS.cookn]: {
text: i18n.t("migration.cookn.description-long"),
acceptedFileType: ".zip",
tree: [
{
icon: $globals.icons.zip,
title: "cookn.zip",
children: [
{ title: "temp_brand.dsv", icon: $globals.icons.codeJson },
{ title: "temp_chapter_desc.dsv", icon: $globals.icons.codeJson },
{ title: "temp_chapter.dsv", icon: $globals.icons.codeJson },
{ title: "temp_cookBook_desc.dsv", icon: $globals.icons.codeJson },
{ title: "temp_cookBook.dsv", icon: $globals.icons.codeJson },
{ title: "temp_food_brand.dsv", icon: $globals.icons.codeJson },
{ title: "temp_food_group.dsv", icon: $globals.icons.codeJson },
{ title: "temp_food.dsv", icon: $globals.icons.codeJson },
{ title: "temp_ingredient.dsv", icon: $globals.icons.codeJson },
{ title: "temp_media.dsv", icon: $globals.icons.codeJson },
{ title: "temp_nutrient.dsv", icon: $globals.icons.codeJson },
{ title: "temp_recipe_desc.dsv", icon: $globals.icons.codeJson },
{ title: "temp_recipe.dsv", icon: $globals.icons.codeJson },
{ title: "temp_unit_equivalent.dsv", icon: $globals.icons.codeJson },
{ title: "temp_unit.dsv", icon: $globals.icons.codeJson },
{ title: "images", icon: $globals.icons.fileImage },
],
},
],
},
};
function addIdToNode(counter: number, node: TreeNode): number {