Skip to content

Commit 8f40d13

Browse files
authored
Merge pull request #3352 from michael-genson/feat/migrate-from-my-recipe-box
feat: Migrate from My Recipe Box
2 parents a6d3163 + 2aaef9a commit 8f40d13

File tree

11 files changed

+540
-89
lines changed

11 files changed

+540
-89
lines changed

frontend/components/global/BaseOverflowButton.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<v-icon>{{ item.icon }}</v-icon>
2121
</v-list-item-icon>
2222
<v-list-item-title>{{ item.text }}</v-list-item-title>
23-
<v-divider v-if="item.divider" :key="`divider-${index}`" class="my-1" ></v-divider>
2423
</v-list-item>
24+
<v-divider v-if="item.divider" :key="`divider-${index}`" class="my-1" ></v-divider>
2525
</template>
2626
</v-list-item-group>
2727
</v-list>
@@ -47,8 +47,8 @@
4747
<v-icon>{{ item.icon }}</v-icon>
4848
</v-list-item-icon>
4949
<v-list-item-title>{{ item.text }}</v-list-item-title>
50-
<v-divider v-if="item.divider" :key="`divider-${index}`" class="my-1" ></v-divider>
5150
</v-list-item>
51+
<v-divider v-if="item.divider" :key="`divider-${index}`" class="my-1" ></v-divider>
5252
</template>
5353
</v-list>
5454
</v-menu>

frontend/lang/messages/en-US.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,18 @@
362362
"choose-migration-type": "Choose Migration Type",
363363
"tag-all-recipes": "Tag all recipes with {tag-name} tag",
364364
"nextcloud-text": "Nextcloud recipes can be imported from a zip file that contains the data stored in Nextcloud. See the example folder structure below to ensure your recipes are able to be imported.",
365-
"chowdown-text": "Mealie natively supports the chowdown repository format. Download the code repository as a .zip file and upload it below",
365+
"chowdown-text": "Mealie natively supports the chowdown repository format. Download the code repository as a .zip file and upload it below.",
366366
"recipe-1": "Recipe 1",
367367
"recipe-2": "Recipe 2",
368368
"paprika-text": "Mealie can import recipes from the Paprika application. Export your recipes from paprika, rename the export extension to .zip and upload it below.",
369369
"mealie-text": "Mealie can import recipes from the Mealie application from a pre v1.0 release. Export your recipes from your old instance, and upload the zip file below. Note that only recipes can be imported from the export.",
370370
"plantoeat": {
371371
"title": "Plan to Eat",
372372
"description-long": "Mealie can import recipies from Plan to Eat."
373+
},
374+
"myrecipebox" : {
375+
"title": "My Recipe Box",
376+
"description-long": "Mealie can import recipes from My Recipe Box. Export your recipes in CSV format, then upload the .csv file below."
373377
}
374378
},
375379
"new-recipe": {

frontend/pages/group/migrations.vue

Lines changed: 104 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<v-card-title class="mt-0"> {{ $t('general.upload-file') }} </v-card-title>
3232
<v-card-text>
3333
<AppButtonUpload
34-
accept=".zip"
34+
:accept="content.acceptedFileType || '.zip'"
3535
class="mb-2"
3636
:post="false"
3737
file-name="file"
@@ -75,13 +75,14 @@ import { useUserApi } from "~/composables/api";
7575
import { SupportedMigrations } from "~/lib/api/types/group";
7676
7777
const MIGRATIONS = {
78-
nextcloud: "nextcloud",
78+
mealie: "mealie_alpha",
7979
chowdown: "chowdown",
8080
copymethat: "copymethat",
81+
myrecipebox: "myrecipebox",
82+
nextcloud: "nextcloud",
8183
paprika: "paprika",
82-
mealie: "mealie_alpha",
83-
tandoor: "tandoor",
8484
plantoeat: "plantoeat",
85+
tandoor: "tandoor",
8586
};
8687
8788
export default defineComponent({
@@ -95,15 +96,16 @@ export default defineComponent({
9596
addMigrationTag: false,
9697
loading: false,
9798
treeState: true,
98-
migrationType: MIGRATIONS.nextcloud as SupportedMigrations,
99+
migrationType: MIGRATIONS.mealie as SupportedMigrations,
99100
fileObject: {} as File,
100101
reports: [] as ReportSummary[],
101102
});
102103
103104
const items: MenuItem[] = [
104105
{
105-
text: i18n.tc("migration.nextcloud.title"),
106-
value: MIGRATIONS.nextcloud,
106+
text: i18n.tc("migration.mealie-pre-v1.title"),
107+
value: MIGRATIONS.mealie,
108+
divider: true,
107109
},
108110
{
109111
text: i18n.tc("migration.chowdown.title"),
@@ -114,50 +116,77 @@ export default defineComponent({
114116
value: MIGRATIONS.copymethat,
115117
},
116118
{
117-
text: i18n.tc("migration.paprika.title"),
118-
value: MIGRATIONS.paprika,
119+
text: i18n.tc("migration.myrecipebox.title"),
120+
value: MIGRATIONS.myrecipebox,
119121
},
120122
{
121-
text: i18n.tc("migration.mealie-pre-v1.title"),
122-
value: MIGRATIONS.mealie,
123+
text: i18n.tc("migration.nextcloud.title"),
124+
value: MIGRATIONS.nextcloud,
123125
},
124126
{
125-
text: i18n.tc("migration.tandoor.title"),
126-
value: MIGRATIONS.tandoor,
127+
text: i18n.tc("migration.paprika.title"),
128+
value: MIGRATIONS.paprika,
127129
},
128130
{
129131
text: i18n.tc("migration.plantoeat.title"),
130132
value: MIGRATIONS.plantoeat,
131133
},
134+
{
135+
text: i18n.tc("migration.tandoor.title"),
136+
value: MIGRATIONS.tandoor,
137+
},
132138
];
133-
134139
const _content = {
135-
[MIGRATIONS.nextcloud]: {
136-
text: i18n.tc("migration.nextcloud.description-long"),
140+
[MIGRATIONS.mealie]: {
141+
text: i18n.tc("migration.mealie-pre-v1.description-long"),
142+
acceptedFileType: ".zip",
137143
tree: [
138144
{
139145
id: 1,
140146
icon: $globals.icons.zip,
141-
name: "nextcloud.zip",
147+
name: "mealie.zip",
142148
children: [
143149
{
144150
id: 2,
145-
name: i18n.t("migration.recipe-1"),
146-
icon: $globals.icons.folderOutline,
147-
children: [
148-
{ id: 3, name: "recipe.json", icon: $globals.icons.codeJson },
149-
{ id: 4, name: "full.jpg", icon: $globals.icons.fileImage },
150-
{ id: 5, name: "thumb.jpg", icon: $globals.icons.fileImage },
151-
],
152-
},
153-
{
154-
id: 6,
155-
name: i18n.t("migration.recipe-2"),
151+
name: "recipes",
156152
icon: $globals.icons.folderOutline,
157153
children: [
158-
{ id: 7, name: "recipe.json", icon: $globals.icons.codeJson },
159-
{ id: 8, name: "full.jpg", icon: $globals.icons.fileImage },
160-
{ id: 9, name: "thumb.jpg", icon: $globals.icons.fileImage },
154+
{
155+
id: 3,
156+
name: "recipe-name",
157+
icon: $globals.icons.folderOutline,
158+
children: [
159+
{ id: 4, name: "recipe-name.json", icon: $globals.icons.codeJson },
160+
{
161+
id: 5,
162+
name: "images",
163+
icon: $globals.icons.folderOutline,
164+
children: [
165+
{ id: 6, name: "original.webp", icon: $globals.icons.codeJson },
166+
{ id: 7, name: "full.jpg", icon: $globals.icons.fileImage },
167+
{ id: 8, name: "thumb.jpg", icon: $globals.icons.fileImage },
168+
],
169+
},
170+
],
171+
},
172+
{
173+
id: 9,
174+
name: "recipe-name-1",
175+
icon: $globals.icons.folderOutline,
176+
children: [
177+
{ id: 10, name: "recipe-name-1.json", icon: $globals.icons.codeJson },
178+
{
179+
id: 11,
180+
name: "images",
181+
icon: $globals.icons.folderOutline,
182+
children: [
183+
{ id: 12, name: "original.webp", icon: $globals.icons.codeJson },
184+
{ id: 13, name: "full.jpg", icon: $globals.icons.fileImage },
185+
{ id: 14, name: "thumb.jpg", icon: $globals.icons.fileImage },
186+
],
187+
},
188+
],
189+
},
161190
],
162191
},
163192
],
@@ -166,6 +195,7 @@ export default defineComponent({
166195
},
167196
[MIGRATIONS.chowdown]: {
168197
text: i18n.tc("migration.chowdown.description-long"),
198+
acceptedFileType: ".zip",
169199
tree: [
170200
{
171201
id: 1,
@@ -198,6 +228,7 @@ export default defineComponent({
198228
},
199229
[MIGRATIONS.copymethat]: {
200230
text: i18n.tc("migration.copymethat.description-long"),
231+
acceptedFileType: ".zip",
201232
tree: [
202233
{
203234
id: 1,
@@ -219,67 +250,66 @@ export default defineComponent({
219250
}
220251
],
221252
},
222-
[MIGRATIONS.paprika]: {
223-
text: i18n.tc("migration.paprika.description-long"),
253+
[MIGRATIONS.myrecipebox]: {
254+
text: i18n.tc("migration.myrecipebox.description-long"),
255+
acceptedFileType: ".csv",
224256
tree: false,
225257
},
226-
[MIGRATIONS.mealie]: {
227-
text: i18n.tc("migration.mealie-pre-v1.description-long"),
258+
[MIGRATIONS.nextcloud]: {
259+
text: i18n.tc("migration.nextcloud.description-long"),
260+
acceptedFileType: ".zip",
228261
tree: [
229262
{
230263
id: 1,
231264
icon: $globals.icons.zip,
232-
name: "mealie.zip",
265+
name: "nextcloud.zip",
233266
children: [
234267
{
235268
id: 2,
236-
name: "recipes",
269+
name: i18n.t("migration.recipe-1"),
237270
icon: $globals.icons.folderOutline,
238271
children: [
239-
{
240-
id: 3,
241-
name: "recipe-name",
242-
icon: $globals.icons.folderOutline,
243-
children: [
244-
{ id: 4, name: "recipe-name.json", icon: $globals.icons.codeJson },
245-
{
246-
id: 5,
247-
name: "images",
248-
icon: $globals.icons.folderOutline,
249-
children: [
250-
{ id: 6, name: "original.webp", icon: $globals.icons.codeJson },
251-
{ id: 7, name: "full.jpg", icon: $globals.icons.fileImage },
252-
{ id: 8, name: "thumb.jpg", icon: $globals.icons.fileImage },
253-
],
254-
},
255-
],
256-
},
257-
{
258-
id: 9,
259-
name: "recipe-name-1",
260-
icon: $globals.icons.folderOutline,
261-
children: [
262-
{ id: 10, name: "recipe-name-1.json", icon: $globals.icons.codeJson },
263-
{
264-
id: 11,
265-
name: "images",
266-
icon: $globals.icons.folderOutline,
267-
children: [
268-
{ id: 12, name: "original.webp", icon: $globals.icons.codeJson },
269-
{ id: 13, name: "full.jpg", icon: $globals.icons.fileImage },
270-
{ id: 14, name: "thumb.jpg", icon: $globals.icons.fileImage },
271-
],
272-
},
273-
],
274-
},
272+
{ id: 3, name: "recipe.json", icon: $globals.icons.codeJson },
273+
{ id: 4, name: "full.jpg", icon: $globals.icons.fileImage },
274+
{ id: 5, name: "thumb.jpg", icon: $globals.icons.fileImage },
275+
],
276+
},
277+
{
278+
id: 6,
279+
name: i18n.t("migration.recipe-2"),
280+
icon: $globals.icons.folderOutline,
281+
children: [
282+
{ id: 7, name: "recipe.json", icon: $globals.icons.codeJson },
283+
{ id: 8, name: "full.jpg", icon: $globals.icons.fileImage },
284+
{ id: 9, name: "thumb.jpg", icon: $globals.icons.fileImage },
275285
],
276286
},
277287
],
278288
},
279289
],
280290
},
291+
[MIGRATIONS.paprika]: {
292+
text: i18n.tc("migration.paprika.description-long"),
293+
acceptedFileType: ".zip",
294+
tree: false,
295+
},
296+
[MIGRATIONS.plantoeat]: {
297+
text: i18n.tc("migration.plantoeat.description-long"),
298+
acceptedFileType: ".zip",
299+
tree: [
300+
{
301+
id: 1,
302+
icon: $globals.icons.zip,
303+
name: "plantoeat-recipes-508318_10-13-2023.zip",
304+
children: [
305+
{ id: 9, name: "plantoeat-recipes-508318_10-13-2023.csv", icon: $globals.icons.codeJson },
306+
],
307+
}
308+
],
309+
},
281310
[MIGRATIONS.tandoor]: {
282311
text: i18n.tc("migration.tandoor.description-long"),
312+
acceptedFileType: ".zip",
283313
tree: [
284314
{
285315
id: 1,
@@ -317,19 +347,6 @@ export default defineComponent({
317347
}
318348
],
319349
},
320-
[MIGRATIONS.plantoeat]: {
321-
text: i18n.tc("migration.plantoeat.description-long"),
322-
tree: [
323-
{
324-
id: 1,
325-
icon: $globals.icons.zip,
326-
name: "plantoeat-recipes-508318_10-13-2023.zip",
327-
children: [
328-
{ id: 9, name: "plantoeat-recipes-508318_10-13-2023.csv", icon: $globals.icons.codeJson },
329-
],
330-
}
331-
],
332-
},
333350
};
334351
335352
function setFileObject(fileObject: File) {
@@ -378,6 +395,7 @@ export default defineComponent({
378395
} else {
379396
return {
380397
text: "",
398+
acceptedFileType: ".zip",
381399
tree: false,
382400
};
383401
}

mealie/routes/groups/controller_migrations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
ChowdownMigrator,
1515
CopyMeThatMigrator,
1616
MealieAlphaMigrator,
17+
MyRecipeBoxMigrator,
1718
NextcloudMigrator,
1819
PaprikaMigrator,
1920
PlanToEatMigrator,
@@ -55,6 +56,7 @@ def start_data_migration(
5556
SupportedMigrations.paprika: PaprikaMigrator,
5657
SupportedMigrations.tandoor: TandoorMigrator,
5758
SupportedMigrations.plantoeat: PlanToEatMigrator,
59+
SupportedMigrations.myrecipebox: MyRecipeBoxMigrator,
5860
}
5961

6062
constructor = table.get(migration_type, None)

mealie/schema/group/group_migration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class SupportedMigrations(str, enum.Enum):
1111
mealie_alpha = "mealie_alpha"
1212
tandoor = "tandoor"
1313
plantoeat = "plantoeat"
14+
myrecipebox = "myrecipebox"
1415

1516

1617
class DataMigrationCreate(MealieModel):

mealie/services/migrations/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .chowdown import *
22
from .copymethat import *
33
from .mealie_alpha import *
4+
from .myrecipebox import *
45
from .nextcloud import *
56
from .paprika import *
67
from .plantoeat import *

0 commit comments

Comments
 (0)