diff --git a/docs/docs/overrides/api.html b/docs/docs/overrides/api.html index 1e2ab3000459..806093125afd 100644 --- a/docs/docs/overrides/api.html +++ b/docs/docs/overrides/api.html @@ -14,7 +14,7 @@
diff --git a/frontend/lang/messages/af-ZA.json b/frontend/lang/messages/af-ZA.json index 599589dbaeeb..44b3ee61ab90 100644 --- a/frontend/lang/messages/af-ZA.json +++ b/frontend/lang/messages/af-ZA.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/ar-SA.json b/frontend/lang/messages/ar-SA.json index d6ad5a0c0d11..94bbc0545d63 100644 --- a/frontend/lang/messages/ar-SA.json +++ b/frontend/lang/messages/ar-SA.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/bg-BG.json b/frontend/lang/messages/bg-BG.json index df57fda23d73..3d529e9630d7 100644 --- a/frontend/lang/messages/bg-BG.json +++ b/frontend/lang/messages/bg-BG.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/ca-ES.json b/frontend/lang/messages/ca-ES.json index 6a00f23deaba..36b948199359 100644 --- a/frontend/lang/messages/ca-ES.json +++ b/frontend/lang/messages/ca-ES.json @@ -345,7 +345,11 @@ "recipe-1": "Recepta 1", "recipe-2": "Recepta 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Afegiu tot d'una", diff --git a/frontend/lang/messages/cs-CZ.json b/frontend/lang/messages/cs-CZ.json index a6d6397e958a..7c0ca6849c7f 100644 --- a/frontend/lang/messages/cs-CZ.json +++ b/frontend/lang/messages/cs-CZ.json @@ -345,7 +345,11 @@ "recipe-1": "Recept 1", "recipe-2": "Recept 2", "paprika-text": "Mealie může importovat recepty z aplikace Paprika. Exportujte své recepty z papriky, přejmenujte příponu exportovaného souboru na .zip a nahrajte jej níže.", - "mealie-text": "V Mealie může importovat recepty z aplikace Mealie z v1.0 a starší. Exportujte své recepty ze staré verze a nahrajte zip soubor níže. Všimněte si, že lze importovat pouze recepty." + "mealie-text": "V Mealie může importovat recepty z aplikace Mealie z v1.0 a starší. Exportujte své recepty ze staré verze a nahrajte zip soubor níže. Všimněte si, že lze importovat pouze recepty.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Hromadné přidání", diff --git a/frontend/lang/messages/da-DK.json b/frontend/lang/messages/da-DK.json index 02b24c6837f0..80eec35e8c84 100644 --- a/frontend/lang/messages/da-DK.json +++ b/frontend/lang/messages/da-DK.json @@ -345,7 +345,11 @@ "recipe-1": "Opskrift 1", "recipe-2": "Opskrift 2", "paprika-text": "Mealie kan importere opskrifter fra Paprika applikationen. Eksporter dine opskrifter fra paprika, omdøbe eksportudvidelsen til .zip og uploade den nedenfor.", - "mealie-text": "Mealie kan importere opskrifter fra Mealie applikationen fra en pre v1.0 udgivelse. Eksporter dine opskrifter fra din gamle installation, og upload zip-filen nedenfor. Bemærk, at kun opskrifter kan importeres fra eksport." + "mealie-text": "Mealie kan importere opskrifter fra Mealie applikationen fra en pre v1.0 udgivelse. Eksporter dine opskrifter fra din gamle installation, og upload zip-filen nedenfor. Bemærk, at kun opskrifter kan importeres fra eksport.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Tilføj", diff --git a/frontend/lang/messages/de-DE.json b/frontend/lang/messages/de-DE.json index a004f43f1cde..f0d4f101bd33 100644 --- a/frontend/lang/messages/de-DE.json +++ b/frontend/lang/messages/de-DE.json @@ -345,7 +345,11 @@ "recipe-1": "Rezept 1", "recipe-2": "Rezept 2", "paprika-text": "Mealie kann Rezepte aus der Paprika-App importieren. Exportiere deine Rezepte in Paprika, ändere die Endung der Export-Datei in .zip und lade sie unten hoch.", - "mealie-text": "Mealie kann Rezepte aus der Mealie-App in einer Version vor v1.0 importieren. Exportiere deine Rezepte aus deiner alten Instanz und lade die Zip-Datei unten hoch. Bitte beachte, dass nur Rezepte aus dem Export importiert werden können." + "mealie-text": "Mealie kann Rezepte aus der Mealie-App in einer Version vor v1.0 importieren. Exportiere deine Rezepte aus deiner alten Instanz und lade die Zip-Datei unten hoch. Bitte beachte, dass nur Rezepte aus dem Export importiert werden können.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Mehrere hinzufügen", diff --git a/frontend/lang/messages/el-GR.json b/frontend/lang/messages/el-GR.json index 41907d8d07ef..de1150d617d9 100644 --- a/frontend/lang/messages/el-GR.json +++ b/frontend/lang/messages/el-GR.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Μαζική Προσθήκη", diff --git a/frontend/lang/messages/en-GB.json b/frontend/lang/messages/en-GB.json index e387a06e9e5a..1f2d267b751a 100644 --- a/frontend/lang/messages/en-GB.json +++ b/frontend/lang/messages/en-GB.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/en-US.json b/frontend/lang/messages/en-US.json index bf2d6a2b14ea..e107864591dc 100644 --- a/frontend/lang/messages/en-US.json +++ b/frontend/lang/messages/en-US.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/es-ES.json b/frontend/lang/messages/es-ES.json index 291c12365eee..d05046f29db4 100644 --- a/frontend/lang/messages/es-ES.json +++ b/frontend/lang/messages/es-ES.json @@ -345,7 +345,11 @@ "recipe-1": "Receta 1", "recipe-2": "Receta 2", "paprika-text": "Mealie puede importar recetas de la aplicación Paprika. Exporta tus recetas de paprika, renombra la extensión del fichero a .zip y súbelo a continuación.", - "mealie-text": "Mealie puede importar recetas de la aplicación Mealie desde una versión anterior a v1.0. Exporta tus recetas de tu antigua instancia y sube el archivo zip a continuación. Ten en cuenta que solo se pueden importar recetas de la exportación." + "mealie-text": "Mealie puede importar recetas de la aplicación Mealie desde una versión anterior a v1.0. Exporta tus recetas de tu antigua instancia y sube el archivo zip a continuación. Ten en cuenta que solo se pueden importar recetas de la exportación.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Añadir en masa", diff --git a/frontend/lang/messages/fi-FI.json b/frontend/lang/messages/fi-FI.json index ee59364d3366..e9eb199fae89 100644 --- a/frontend/lang/messages/fi-FI.json +++ b/frontend/lang/messages/fi-FI.json @@ -345,7 +345,11 @@ "recipe-1": "Resepti 1", "recipe-2": "Resepti 2", "paprika-text": "Mealie voi tuoda reseptejä Paprika-sovelluksesta. Vie reseptisi ohjelmasta ulos, nimeä tiedoston pääte uudelleen .zip ja lataa se alla.", - "mealie-text": "Mealie voi tuoda reseptejä Mealie sovelluksesta ennen v1.0 julkaisua. Vie reseptisi vanhasta asennuksesta ja lataa zip-tiedosto. Huomaa, että viennistä voidaan tuoda vain reseptejä." + "mealie-text": "Mealie voi tuoda reseptejä Mealie sovelluksesta ennen v1.0 julkaisua. Vie reseptisi vanhasta asennuksesta ja lataa zip-tiedosto. Huomaa, että viennistä voidaan tuoda vain reseptejä.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Lisää useita kerralla", diff --git a/frontend/lang/messages/fr-CA.json b/frontend/lang/messages/fr-CA.json index 81f19bdb112f..def095bdfb47 100644 --- a/frontend/lang/messages/fr-CA.json +++ b/frontend/lang/messages/fr-CA.json @@ -345,7 +345,11 @@ "recipe-1": "Recette 1", "recipe-2": "Recette 2", "paprika-text": "Mealie peut importer des recettes depuis l'application Paprika. Exportez vos recettes de paprika, renommez l'extension d'exportation en .zip et téléchargez-les ci-dessous.", - "mealie-text": "Mealie peut importer des recettes depuis l'application Mealie depuis une version antérieure à 1.0. Exportez vos recettes depuis votre ancienne instance, et téléchargez le fichier zip ci-dessous. Notez que seules les recettes peuvent être importées à partir de l'exportation." + "mealie-text": "Mealie peut importer des recettes depuis l'application Mealie depuis une version antérieure à 1.0. Exportez vos recettes depuis votre ancienne instance, et téléchargez le fichier zip ci-dessous. Notez que seules les recettes peuvent être importées à partir de l'exportation.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Ajouter en masse", diff --git a/frontend/lang/messages/fr-FR.json b/frontend/lang/messages/fr-FR.json index bee095d5cdf5..eb3e838c1a6d 100644 --- a/frontend/lang/messages/fr-FR.json +++ b/frontend/lang/messages/fr-FR.json @@ -345,7 +345,11 @@ "recipe-1": "Recette 1", "recipe-2": "Recette 2", "paprika-text": "Mealie peut importer des recettes depuis l'application Paprika. Exportez vos recettes de paprika, renommez l'extension d'exportation en .zip et téléchargez-les ci-dessous.", - "mealie-text": "Mealie peut importer des recettes depuis l'application Mealie depuis une version antérieure à 1.0. Exportez vos recettes depuis votre ancienne instance, et téléchargez le fichier zip ci-dessous. Notez que seules les recettes peuvent être importées à partir de l'exportation." + "mealie-text": "Mealie peut importer des recettes depuis l'application Mealie depuis une version antérieure à 1.0. Exportez vos recettes depuis votre ancienne instance, et téléchargez le fichier zip ci-dessous. Notez que seules les recettes peuvent être importées à partir de l'exportation.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Ajouter en masse", diff --git a/frontend/lang/messages/gl-ES.json b/frontend/lang/messages/gl-ES.json index 9266a917405e..6c4025f9cf24 100644 --- a/frontend/lang/messages/gl-ES.json +++ b/frontend/lang/messages/gl-ES.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/he-IL.json b/frontend/lang/messages/he-IL.json index 50080c45a87e..2e8edefa7d18 100644 --- a/frontend/lang/messages/he-IL.json +++ b/frontend/lang/messages/he-IL.json @@ -345,7 +345,11 @@ "recipe-1": "מתכון 1", "recipe-2": "מתכון 2", "paprika-text": "מילי יכולה לייבא מתכונים מאפליקציית Paprika. ייצא את המתכונים מהאפליקציה, שנה את סיומת הקובץ ל- zip והעלה אותו למטה.", - "mealie-text": "Mealie יכול לייבא מתכונים מגרסאות ישנות של Mealie מתחת ל- v1.0. ייצא את המתכונים מהסביבה הישנה והעלה את קובץ ה- zip למטה. ניתן לייבא רק מתכונים מתהליך הייצוא." + "mealie-text": "Mealie יכול לייבא מתכונים מגרסאות ישנות של Mealie מתחת ל- v1.0. ייצא את המתכונים מהסביבה הישנה והעלה את קובץ ה- zip למטה. ניתן לייבא רק מתכונים מתהליך הייצוא.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "הוספה כמותית", diff --git a/frontend/lang/messages/hr-HR.json b/frontend/lang/messages/hr-HR.json index 4427c3e4c9d8..4010d6512ac7 100644 --- a/frontend/lang/messages/hr-HR.json +++ b/frontend/lang/messages/hr-HR.json @@ -345,7 +345,11 @@ "recipe-1": "Recept 1", "recipe-2": "Recept 2", "paprika-text": "Mealie može uvesti recepte iz aplikacije Paprika. Izvezite svoje recepte iz Paprike, preimenujte ekstenziju izvoza u .zip i učitajte je u nastavku.", - "mealie-text": "Mealie može uvesti recepte iz Mealie aplikacije iz verzije prije v1.0. Izvezite svoje recepte iz starog primjerka i učitajte zip datoteku u nastavku. Napomena: Samo recepti mogu biti uvezeni iz izvoza." + "mealie-text": "Mealie može uvesti recepte iz Mealie aplikacije iz verzije prije v1.0. Izvezite svoje recepte iz starog primjerka i učitajte zip datoteku u nastavku. Napomena: Samo recepti mogu biti uvezeni iz izvoza.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Dodajte više recepata odjednom", diff --git a/frontend/lang/messages/hu-HU.json b/frontend/lang/messages/hu-HU.json index f4c4e6f7e024..90e47e64002b 100644 --- a/frontend/lang/messages/hu-HU.json +++ b/frontend/lang/messages/hu-HU.json @@ -345,7 +345,11 @@ "recipe-1": "Recept 1", "recipe-2": "Recept 2", "paprika-text": "Mealie képes recepteket importálni a Paprika alkalmazásból. Exportálja a receptjeit a Paprikából, nevezze át az export kiterjesztést .zip-re, és töltse fel alább.", - "mealie-text": "Mealie képes a v1.0 előtti kiadású Mealie alkalmazásból származó receptek importálására. Exportálja a receptjeit a régi példányából, és töltse fel a zip fájlt alább. Vegye figyelembe, hogy az exportból csak receptek importálhatók." + "mealie-text": "Mealie képes a v1.0 előtti kiadású Mealie alkalmazásból származó receptek importálására. Exportálja a receptjeit a régi példányából, és töltse fel a zip fájlt alább. Vegye figyelembe, hogy az exportból csak receptek importálhatók.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Tömeges hozzáadás", diff --git a/frontend/lang/messages/it-IT.json b/frontend/lang/messages/it-IT.json index 68501532f259..650e5a6e593f 100644 --- a/frontend/lang/messages/it-IT.json +++ b/frontend/lang/messages/it-IT.json @@ -345,7 +345,11 @@ "recipe-1": "Ricetta 1", "recipe-2": "Ricetta 2", "paprika-text": "Mealie può importare ricette dall'applicazione Paprika. Esporta le tue ricette da paprika, rinomina l'estensione di esportazione in .zip e caricala qui sotto.", - "mealie-text": "Mealie può importare ricette dall'applicazione Mealie da un versione pre v1.0. Esporta le tue ricette dalla tua vecchia istanza e carica il file zip qui sotto. Nota che solo le ricette possono essere importate dall'esportazione." + "mealie-text": "Mealie può importare ricette dall'applicazione Mealie da un versione pre v1.0. Esporta le tue ricette dalla tua vecchia istanza e carica il file zip qui sotto. Nota che solo le ricette possono essere importate dall'esportazione.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Inserimento Multiplo", diff --git a/frontend/lang/messages/ja-JP.json b/frontend/lang/messages/ja-JP.json index bc9285b9083c..0db14c9e5530 100644 --- a/frontend/lang/messages/ja-JP.json +++ b/frontend/lang/messages/ja-JP.json @@ -345,7 +345,11 @@ "recipe-1": "レシピ1", "recipe-2": "レシピ2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/ko-KR.json b/frontend/lang/messages/ko-KR.json index 5bbea68b7b63..4887360c5bcb 100644 --- a/frontend/lang/messages/ko-KR.json +++ b/frontend/lang/messages/ko-KR.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/lt-LT.json b/frontend/lang/messages/lt-LT.json index 9252f7fcb8e1..3df6fa0bc864 100644 --- a/frontend/lang/messages/lt-LT.json +++ b/frontend/lang/messages/lt-LT.json @@ -345,7 +345,11 @@ "recipe-1": "Receptas 1", "recipe-2": "Receptas 2", "paprika-text": "Į Mealie galima importuoti receptus iš \"Paprika\" sistemos. Eksportuokite duomenis iš \"Paprika\", pervadinkite failo plėtinį į .ZIP ir įkelkite žemiau.", - "mealie-text": "Į Mealie galima importuoti receptus iš senesnių už v1.0 Mealie versijų. Eksportuokite receptus iš senosios sistemos ir įkelkite .ZIP failą žemiau. Svarbu: perkeliami tik receptų duomenys." + "mealie-text": "Į Mealie galima importuoti receptus iš senesnių už v1.0 Mealie versijų. Eksportuokite receptus iš senosios sistemos ir įkelkite .ZIP failą žemiau. Svarbu: perkeliami tik receptų duomenys.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Pridėti urmu", diff --git a/frontend/lang/messages/lv-LV.json b/frontend/lang/messages/lv-LV.json index 9266a917405e..6c4025f9cf24 100644 --- a/frontend/lang/messages/lv-LV.json +++ b/frontend/lang/messages/lv-LV.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/nl-NL.json b/frontend/lang/messages/nl-NL.json index 45f129e08ae8..16bc55547ab2 100644 --- a/frontend/lang/messages/nl-NL.json +++ b/frontend/lang/messages/nl-NL.json @@ -345,7 +345,11 @@ "recipe-1": "Eerste recept", "recipe-2": "Tweede recept", "paprika-text": "Mealie kan recepten uit het programma Paprika importeren. Exporteer je recepten uit Paprika, hernoem de exportuitbreiding naar .zip en upload ze hieronder.", - "mealie-text": "Mealie kan recepten importeren uit oude versies van Mealie (voor versie 1.0). Exporteer je recepten vanuit de oude versie, en upload het zip-bestand hieronder. Let op dat alleen recepten uit de export kunnen worden geïmporteerd." + "mealie-text": "Mealie kan recepten importeren uit oude versies van Mealie (voor versie 1.0). Exporteer je recepten vanuit de oude versie, en upload het zip-bestand hieronder. Let op dat alleen recepten uit de export kunnen worden geïmporteerd.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk toevoegen", diff --git a/frontend/lang/messages/no-NO.json b/frontend/lang/messages/no-NO.json index 25861854e72f..2d3fd4530b83 100644 --- a/frontend/lang/messages/no-NO.json +++ b/frontend/lang/messages/no-NO.json @@ -345,7 +345,11 @@ "recipe-1": "Oppskrift 1", "recipe-2": "Oppskrift 2", "paprika-text": "Mealie kan importere oppskrifter fra Paprika. Eksporter oppskriftene fra paprika, gi den et nytt navn til .zip-eksportutvidelsen og last den opp nedenfor.", - "mealie-text": "Mealie kan importere oppskrifter fra Mealie-appen fra versjoner før v1.0. Eksporter oppskriftene fra din gamle versjon, og last opp zip-filen under. Merk at bare oppskrifter kan importeres fra eksporten." + "mealie-text": "Mealie kan importere oppskrifter fra Mealie-appen fra versjoner før v1.0. Eksporter oppskriftene fra din gamle versjon, og last opp zip-filen under. Merk at bare oppskrifter kan importeres fra eksporten.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Opprett flere", diff --git a/frontend/lang/messages/pl-PL.json b/frontend/lang/messages/pl-PL.json index 0bb5c3c530ac..99d2c919ff0a 100644 --- a/frontend/lang/messages/pl-PL.json +++ b/frontend/lang/messages/pl-PL.json @@ -345,7 +345,11 @@ "recipe-1": "Przepis 1", "recipe-2": "Przepis 2", "paprika-text": "Mealie może importować przepisy z aplikacji Paprika. Eksportuj swoje przepisy z papriki, zmień nazwę rozszerzenia eksportu na .zip i prześlij je poniżej.", - "mealie-text": "Mealie może importować receptury z aplikacji Mealie z wersji przed v1.0. Wyeksportuj swoje przepisy ze starej instancji i prześlij plik zip poniżej. Pamiętaj, że tylko receptury mogą być zaimportowane z eksportu." + "mealie-text": "Mealie może importować receptury z aplikacji Mealie z wersji przed v1.0. Wyeksportuj swoje przepisy ze starej instancji i prześlij plik zip poniżej. Pamiętaj, że tylko receptury mogą być zaimportowane z eksportu.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Dodanie zbiorcze", diff --git a/frontend/lang/messages/pt-BR.json b/frontend/lang/messages/pt-BR.json index 869b249d912f..04debbe77f46 100644 --- a/frontend/lang/messages/pt-BR.json +++ b/frontend/lang/messages/pt-BR.json @@ -345,7 +345,11 @@ "recipe-1": "Receita 1", "recipe-2": "Receita 2", "paprika-text": "Mealie pode importar receitas do aplicativo Paprika. Exporte suas receitas do Paprika, renomeie a extensão do arquivo para .zip e carregue-o abaixo.", - "mealie-text": "Mealie pode importar receitas do aplicativo Mealie a partir de uma versão pré-v1.0. Exporte suas receitas de sua instância antiga e carregue o arquivo zip abaixo. Note que apenas as receitas podem ser importadas da exportação." + "mealie-text": "Mealie pode importar receitas do aplicativo Mealie a partir de uma versão pré-v1.0. Exporte suas receitas de sua instância antiga e carregue o arquivo zip abaixo. Note que apenas as receitas podem ser importadas da exportação.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Adicionar em Massa", diff --git a/frontend/lang/messages/pt-PT.json b/frontend/lang/messages/pt-PT.json index a7c1658a07f2..bc54c27320bc 100644 --- a/frontend/lang/messages/pt-PT.json +++ b/frontend/lang/messages/pt-PT.json @@ -345,7 +345,11 @@ "recipe-1": "Receita 1", "recipe-2": "Receita 2", "paprika-text": "O Mealie pode importar receitas da app Paprika. Exporte as suas receitas do Paprika, renomeie a extensão do ficheiro exportado para .zip e carregue-o mais abaixo.", - "mealie-text": "O Mealie pode importar receitas de versões do Mealie anteriores à 1.0. Exporte as suas receitas na instância antiga e carregue o ficheiro zip mais abaixo. Note que só podem ser importadas as receitas dessa exportação." + "mealie-text": "O Mealie pode importar receitas de versões do Mealie anteriores à 1.0. Exporte as suas receitas na instância antiga e carregue o ficheiro zip mais abaixo. Note que só podem ser importadas as receitas dessa exportação.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Adicionar Vários", diff --git a/frontend/lang/messages/ro-RO.json b/frontend/lang/messages/ro-RO.json index c53a25d7480f..ae63497138a5 100644 --- a/frontend/lang/messages/ro-RO.json +++ b/frontend/lang/messages/ro-RO.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/ru-RU.json b/frontend/lang/messages/ru-RU.json index 8fe02947e0dd..6b5f4ab8d1d6 100644 --- a/frontend/lang/messages/ru-RU.json +++ b/frontend/lang/messages/ru-RU.json @@ -345,7 +345,11 @@ "recipe-1": "Рецепт 1", "recipe-2": "Рецепт 2", "paprika-text": "Mealie может импортировать рецепты из приложения Paprika. Экспортируйте рецепты из paprika, измените расширение для экспорта в .zip и загрузить его ниже.", - "mealie-text": "Mealie может импортировать рецепты из приложения Mealie из версии до версии 1.0. Экспортируйте рецепты из старой версии приложения и загрузите zip-файл ниже. Заметьте, что только рецепты могут быть импортированы из экспорта." + "mealie-text": "Mealie может импортировать рецепты из приложения Mealie из версии до версии 1.0. Экспортируйте рецепты из старой версии приложения и загрузите zip-файл ниже. Заметьте, что только рецепты могут быть импортированы из экспорта.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Массовое добавление", diff --git a/frontend/lang/messages/sk-SK.json b/frontend/lang/messages/sk-SK.json index aeb6593bef48..f613d74e4d37 100644 --- a/frontend/lang/messages/sk-SK.json +++ b/frontend/lang/messages/sk-SK.json @@ -345,7 +345,11 @@ "recipe-1": "Recept 1", "recipe-2": "Recept 2", "paprika-text": "Mealie dokáže importovať recepty z aplikácie Paprika. Exportujte vaše recepty z Papriky, premenujte príponu exportovaného súboru na .zip a nahrajte ho nižšie.", - "mealie-text": "Mealie dokáže importovať recepty z Mealie verzie pre v1.0. Exportujte vaše recepty z vašej starej inštalácie a nižšie nahrajte zip-súbor. Týmto spôsobom je možné z exportu importovať iba recepty." + "mealie-text": "Mealie dokáže importovať recepty z Mealie verzie pre v1.0. Exportujte vaše recepty z vašej starej inštalácie a nižšie nahrajte zip-súbor. Týmto spôsobom je možné z exportu importovať iba recepty.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Hromadné pridanie", diff --git a/frontend/lang/messages/sl-SI.json b/frontend/lang/messages/sl-SI.json index 5399d7551917..d7e878028aa6 100644 --- a/frontend/lang/messages/sl-SI.json +++ b/frontend/lang/messages/sl-SI.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Množično dodajanje", diff --git a/frontend/lang/messages/sr-SP.json b/frontend/lang/messages/sr-SP.json index 5c6058d95daa..6c898c248583 100644 --- a/frontend/lang/messages/sr-SP.json +++ b/frontend/lang/messages/sr-SP.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/sv-SE.json b/frontend/lang/messages/sv-SE.json index e4eb4d56726d..bc384aeb9d3e 100644 --- a/frontend/lang/messages/sv-SE.json +++ b/frontend/lang/messages/sv-SE.json @@ -345,7 +345,11 @@ "recipe-1": "Recept 1", "recipe-2": "Recept 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Lägg till flera", diff --git a/frontend/lang/messages/tr-TR.json b/frontend/lang/messages/tr-TR.json index 3a015cf66096..9cfa80e9c3ff 100644 --- a/frontend/lang/messages/tr-TR.json +++ b/frontend/lang/messages/tr-TR.json @@ -345,7 +345,11 @@ "recipe-1": "Tarif 1", "recipe-2": "Tarif 2", "paprika-text": "Mealie, Paprika uygulamasından tarifleri içe aktarabilir. Tariflerinizi paprika'dan dışa aktarın, dışa aktarma uzantısını .zip olarak yeniden adlandırın ve aşağıda yükleyin.", - "mealie-text": "Mealie, v1.0 öncesi bir sürümden Mealie uygulamasından tarifleri içe aktarabilir. Tariflerinizi eski örneğinizden dışa aktarın ve aşağıdaki zip dosyasını yükleyin. Dışa aktarmadan yalnızca tariflerin içe aktarılabileceğini unutmayın." + "mealie-text": "Mealie, v1.0 öncesi bir sürümden Mealie uygulamasından tarifleri içe aktarabilir. Tariflerinizi eski örneğinizden dışa aktarın ve aşağıdaki zip dosyasını yükleyin. Dışa aktarmadan yalnızca tariflerin içe aktarılabileceğini unutmayın.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Toplu Ekle", diff --git a/frontend/lang/messages/uk-UA.json b/frontend/lang/messages/uk-UA.json index 93c918b3509c..8bfa07dc73c4 100644 --- a/frontend/lang/messages/uk-UA.json +++ b/frontend/lang/messages/uk-UA.json @@ -345,7 +345,11 @@ "recipe-1": "Рецепт 1", "recipe-2": "Рецепт 2", "paprika-text": "Mealie може імпортувати рецепти з додатку Paprika. Експортуйте ваші рецепти з Paprika, перейменуйте розширення експорту в .zip та відвантажте його нижче.", - "mealie-text": "Mealie може імпортувати рецепти з Mealie до версії 1.0. Експортуйте свої рецепти зі старої Mealie і відвантажте zip-файл нижче. Зверніть увагу, що тільки рецепти можуть бути імпортовані з експорту." + "mealie-text": "Mealie може імпортувати рецепти з Mealie до версії 1.0. Експортуйте свої рецепти зі старої Mealie і відвантажте zip-файл нижче. Зверніть увагу, що тільки рецепти можуть бути імпортовані з експорту.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Масове додавання", diff --git a/frontend/lang/messages/vi-VN.json b/frontend/lang/messages/vi-VN.json index aae3fd471d5d..881829845f8a 100644 --- a/frontend/lang/messages/vi-VN.json +++ b/frontend/lang/messages/vi-VN.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "Bulk Add", diff --git a/frontend/lang/messages/zh-CN.json b/frontend/lang/messages/zh-CN.json index 371b655a3df1..28761a94393f 100644 --- a/frontend/lang/messages/zh-CN.json +++ b/frontend/lang/messages/zh-CN.json @@ -345,7 +345,11 @@ "recipe-1": "食谱 1", "recipe-2": "食谱 2", "paprika-text": "Mealie 可以从 Paprika 导入食谱。请从paprika 导出食谱,重命名导出文件并压缩成.zip格式后,在下方上传", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "批量添加", diff --git a/frontend/lang/messages/zh-TW.json b/frontend/lang/messages/zh-TW.json index 4cba35abaf70..1e3a00b7a8a8 100644 --- a/frontend/lang/messages/zh-TW.json +++ b/frontend/lang/messages/zh-TW.json @@ -345,7 +345,11 @@ "recipe-1": "Recipe 1", "recipe-2": "Recipe 2", "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.", - "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." + "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.", + "plantoeat": { + "title": "Plan to Eat", + "description-long": "Mealie can import recipies from Plan to Eat." + } }, "new-recipe": { "bulk-add": "批量添加", diff --git a/frontend/lib/api/types/group.ts b/frontend/lib/api/types/group.ts index 42fb45a85461..6e0be1ebe40a 100644 --- a/frontend/lib/api/types/group.ts +++ b/frontend/lib/api/types/group.ts @@ -6,7 +6,7 @@ */ export type WebhookType = "mealplan"; -export type SupportedMigrations = "nextcloud" | "chowdown" | "copymethat" | "paprika" | "mealie_alpha" | "tandoor"; +export type SupportedMigrations = "nextcloud" | "chowdown" | "copymethat" | "paprika" | "mealie_alpha" | "tandoor" | "plantoeat"; export interface CreateGroupPreferences { privateGroup?: boolean; diff --git a/frontend/pages/group/migrations.vue b/frontend/pages/group/migrations.vue index 724ff6173c10..5d628dd4de83 100644 --- a/frontend/pages/group/migrations.vue +++ b/frontend/pages/group/migrations.vue @@ -81,6 +81,7 @@ const MIGRATIONS = { paprika: "paprika", mealie: "mealie_alpha", tandoor: "tandoor", + plantoeat: "plantoeat", }; export default defineComponent({ @@ -123,6 +124,10 @@ export default defineComponent({ text: i18n.tc("migration.tandoor.title"), value: MIGRATIONS.tandoor, }, + { + text: i18n.tc("migration.plantoeat.title"), + value: MIGRATIONS.plantoeat, + }, ]; const _content = { @@ -311,6 +316,19 @@ export default defineComponent({ } ], }, + [MIGRATIONS.plantoeat]: { + text: i18n.tc("migration.plantoeat.description-long"), + tree: [ + { + id: 1, + icon: $globals.icons.zip, + name: "plantoeat-recipes-508318_10-13-2023.zip", + children: [ + { id: 9, name: "plantoeat-recipes-508318_10-13-2023.csv", icon: $globals.icons.codeJson }, + ], + } + ], + }, }; function setFileObject(fileObject: File) { diff --git a/mealie/routes/groups/controller_migrations.py b/mealie/routes/groups/controller_migrations.py index 06a4ebb4f1d8..3beba1083f41 100644 --- a/mealie/routes/groups/controller_migrations.py +++ b/mealie/routes/groups/controller_migrations.py @@ -16,6 +16,7 @@ from mealie.services.migrations import ( MealieAlphaMigrator, NextcloudMigrator, PaprikaMigrator, + PlanToEatMigrator, TandoorMigrator, ) @@ -52,6 +53,7 @@ class GroupMigrationController(BaseUserController): SupportedMigrations.nextcloud: NextcloudMigrator, SupportedMigrations.paprika: PaprikaMigrator, SupportedMigrations.tandoor: TandoorMigrator, + SupportedMigrations.plantoeat: PlanToEatMigrator, } constructor = table.get(migration_type, None) diff --git a/mealie/schema/group/group_migration.py b/mealie/schema/group/group_migration.py index ece0ffb5d9a8..4e0d381192db 100644 --- a/mealie/schema/group/group_migration.py +++ b/mealie/schema/group/group_migration.py @@ -10,6 +10,7 @@ class SupportedMigrations(str, enum.Enum): paprika = "paprika" mealie_alpha = "mealie_alpha" tandoor = "tandoor" + plantoeat = "plantoeat" class DataMigrationCreate(MealieModel): diff --git a/mealie/services/migrations/__init__.py b/mealie/services/migrations/__init__.py index 9e8493133726..0b6fa412ed16 100644 --- a/mealie/services/migrations/__init__.py +++ b/mealie/services/migrations/__init__.py @@ -3,4 +3,5 @@ from .copymethat import * from .mealie_alpha import * from .nextcloud import * from .paprika import * +from .plantoeat import * from .tandoor import * diff --git a/mealie/services/migrations/plantoeat.py b/mealie/services/migrations/plantoeat.py new file mode 100644 index 000000000000..564a39186017 --- /dev/null +++ b/mealie/services/migrations/plantoeat.py @@ -0,0 +1,117 @@ +import asyncio +import csv +import tempfile +import zipfile +from pathlib import Path + +from slugify import slugify + +from mealie.pkgs.cache import cache_key +from mealie.services.scraper import cleaner + +from ._migration_base import BaseMigrator +from .utils.migration_alias import MigrationAlias +from .utils.migration_helpers import scrape_image, split_by_comma + + +def plantoeat_recipes(file: Path): + """Yields all recipes inside the export file as dict""" + with tempfile.TemporaryDirectory() as tmpdir: + with zipfile.ZipFile(file) as zip_file: + zip_file.extractall(tmpdir) + + for name in Path(tmpdir).glob("**/[!.]*.csv"): + with open(name, newline="") as csvfile: + reader = csv.DictReader(csvfile) + for row in reader: + yield row + + +def get_value_as_string_or_none(dictionary: dict, key: str): + value = dictionary.get(key) + if value is not None: + try: + return str(value) + except Exception: + return None + else: + return None + + +class PlanToEatMigrator(BaseMigrator): + def __init__(self, **kwargs): + super().__init__(**kwargs) + + self.name = "plantoeat" + + self.key_aliases = [ + MigrationAlias(key="name", alias="Title"), + MigrationAlias(key="description", alias="Description"), + MigrationAlias( + key="recipeIngredient", + alias="Ingredients", + func=lambda x: [z for z in x.splitlines() if z.strip() and not z.startswith(", ")], + ), + MigrationAlias(key="recipeInstructions", alias="Directions"), + MigrationAlias(key="recipeYield", alias="Servings"), + MigrationAlias(key="orgURL", alias="Url"), + MigrationAlias(key="rating", alias="Rating"), + MigrationAlias(key="prepTime", alias="Prep Time"), + MigrationAlias(key="performTime", alias="Cook Time"), + MigrationAlias(key="totalTime", alias="Total Time"), + MigrationAlias(key="tags", alias="Tags", func=split_by_comma), + MigrationAlias(key="dateAdded", alias="Created At", func=lambda x: x[: x.find(" ")]), + ] + + def _parse_recipe_nutrition_from_row(self, row: dict) -> dict: + """Parses the nutrition data from the row""" + + nut_dict: dict = {} + + nut_dict["calories"] = get_value_as_string_or_none(row, "Calories") + nut_dict["fatContent"] = get_value_as_string_or_none(row, "Fat") + nut_dict["proteinContent"] = get_value_as_string_or_none(row, "Protein") + nut_dict["carbohydrateContent"] = get_value_as_string_or_none(row, "Carbohydrate") + nut_dict["fiberContent"] = get_value_as_string_or_none(row, "Fiber") + nut_dict["sodiumContent"] = get_value_as_string_or_none(row, "Sodium") + nut_dict["sugarContent"] = get_value_as_string_or_none(row, "Sugar") + + return cleaner.clean_nutrition(nut_dict) + + def _process_recipe_row(self, row: dict) -> dict: + """Reads a single recipe's row, parses its nutrition, and converts it to a dictionary""" + + recipe_dict: dict = row + + recipe_dict["nutrition"] = self._parse_recipe_nutrition_from_row(row) + + return recipe_dict + + def _migrate(self) -> None: + recipe_image_urls = {} + + recipes = [] + for recipe in plantoeat_recipes(self.archive): + if "Title" not in recipe: + continue + + if "Photo Url" in recipe: + recipe_image_urls[slugify(recipe["Title"])] = recipe["Photo Url"] + recipe["image"] = cache_key.new_key(4) + + preprocess_recipe = self._process_recipe_row(recipe) + + recipe_model = self.clean_recipe_dictionary(preprocess_recipe) + + recipes.append(recipe_model) + + results = self.import_recipes_to_database(recipes) + + for slug, recipe_id, status in results: + if not status: + continue + + try: + asyncio.run(scrape_image(recipe_image_urls[slug], recipe_id)) + except Exception as e: + self.logger.error(f"Failed to download image for {slug}: {e}") diff --git a/mealie/services/migrations/utils/migration_helpers.py b/mealie/services/migrations/utils/migration_helpers.py index 3c1110b33115..18dc094189d6 100644 --- a/mealie/services/migrations/utils/migration_helpers.py +++ b/mealie/services/migrations/utils/migration_helpers.py @@ -100,3 +100,20 @@ def import_image(src: str | Path, recipe_id: UUID4): data_service.write_image(src, src.suffix) except UnidentifiedImageError: return + + +async def scrape_image(image_url: str, recipe_id: UUID4): + """Read the successful migrations attribute and for each scrape the image + appropriately into the image directory. Minification is done in mass + after the migration occurs. + """ + + if not isinstance(image_url, str): + return + + data_service = RecipeDataService(recipe_id=recipe_id) + + try: + await data_service.scrape_image(image_url) + except UnidentifiedImageError: + return diff --git a/mealie/services/scraper/cleaner.py b/mealie/services/scraper/cleaner.py index 1637564bfcaa..05c82535a5b0 100644 --- a/mealie/services/scraper/cleaner.py +++ b/mealie/services/scraper/cleaner.py @@ -260,7 +260,7 @@ def clean_ingredients(ingredients: list | str | None, default: list | None = Non case [str()]: return [clean_string(ingredient) for ingredient in ingredients] case str(ingredients): - return [clean_string(ingredient) for ingredient in ingredients.splitlines()] + return [clean_string(ingredient) for ingredient in ingredients.splitlines() if ingredient.strip()] case _: raise TypeError(f"Unexpected type for ingredients: {type(ingredients)}, {ingredients}") diff --git a/tests/data/__init__.py b/tests/data/__init__.py index 4ea2d4362408..445426def3ee 100644 --- a/tests/data/__init__.py +++ b/tests/data/__init__.py @@ -16,6 +16,8 @@ migrations_nextcloud = CWD / "migrations/nextcloud.zip" migrations_tandoor = CWD / "migrations/tandoor.zip" +migrations_plantoeat = CWD / "migrations/plantoeat.zip" + images_test_image_1 = CWD / "images/test-image-1.jpg" images_test_image_2 = CWD / "images/test-image-2.png" diff --git a/tests/data/migrations/plantoeat.zip b/tests/data/migrations/plantoeat.zip new file mode 100644 index 000000000000..4ea379c125eb Binary files /dev/null and b/tests/data/migrations/plantoeat.zip differ diff --git a/tests/integration_tests/recipe_migration_tests/test_recipe_migrations.py b/tests/integration_tests/recipe_migration_tests/test_recipe_migrations.py index 24be48ad136a..7bdc1bc79b0f 100644 --- a/tests/integration_tests/recipe_migration_tests/test_recipe_migrations.py +++ b/tests/integration_tests/recipe_migration_tests/test_recipe_migrations.py @@ -24,6 +24,7 @@ test_cases = [ MigrationTestData(typ=SupportedMigrations.copymethat, archive=test_data.migrations_copymethat), MigrationTestData(typ=SupportedMigrations.mealie_alpha, archive=test_data.migrations_mealie), MigrationTestData(typ=SupportedMigrations.tandoor, archive=test_data.migrations_tandoor), + MigrationTestData(typ=SupportedMigrations.plantoeat, archive=test_data.migrations_plantoeat), ] test_ids = [ @@ -33,6 +34,7 @@ test_ids = [ "copymethat_archive", "mealie_alpha_archive", "tandoor_archive", + "plantoeat_archive", ]