-
Notifications
You must be signed in to change notification settings - Fork 1
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
Meal plan with notes throws error #2
Comments
It looks like this can be fixed by checking if This diff makes it so there is no longer an error: diff --git a/MMM-MealieMenu.js b/MMM-MealieMenu.js
index 2a5fac5..cc82c71 100644
--- a/MMM-MealieMenu.js
+++ b/MMM-MealieMenu.js
@@ -276,11 +276,11 @@ Module.register("MMM-MealieMenu", {
const formatted = [];
for (const meal of meals) {
formatted.push({
- name: meal.recipe.name,
+ name: meal.recipe ? meal.recipe.name : meal.title,
rawDate: meal.date,
date: moment(meal.date).format(this.config.dateFormat),
meal: this.typeToMealDisplay(meal.entryType),
- photoUrl: `${this.config.host}/api/media/recipes/${meal.recipe.id}/images/min-original.webp`,
+ photoUrl: meal.recipe ? `${this.config.host}/api/media/recipes/${meal.recipe.id}/images/min-original.webp` : '',
isToday: today.isSame(meal.date),
shouldFade: this.config.fadePriorEntries && today.isAfter(meal.date)
}); However, I think it might be nice to have a default image in case the recipe or the note doesn't have a picture. I can open up a PR for this if you'd like, but wouldn't know what to do for the image. |
Yep, that is true. I have not used the "Note only" option in quite some time and I forgot it exists.
Maybe using the Mealie icon would work? I could also add a |
I'm planning on including a PNG version with an orange background and white icon, which is how it looks in the header of Mealie. I will also add the
Thanks! I previously used Paprika and the MMM-PaprikaMenu module, but then I switched to Mealie and needed this module. I should be able to update the code later today. |
The meal plan notes issue is fixed in fdfe249 I'll get the defaultImage setting added tomorrow. |
Fix works for me, thanks! |
- Meal plan notes in the meal plan don't result in an error Fixes #2
- Add default photo when a photo is not available for a meal plan - Default photo is the Mealie icon - Add `defaultPicture` option to change the image - Add recipe description or meal note, default is hidden - Add `showDescription` to toggle the description - Wrap meal name to single line Closes #2
- Add default photo when a photo is not available for a meal plan - Default photo is the Mealie icon - Add `defaultPicture` option to change the image - Add recipe description or meal note, default is hidden - Add `showDescription` to toggle the description - Wrap meal name to single line Closes #2
- Add default photo when a photo is not available for a meal plan - Default photo is the Mealie icon - Add `defaultPicture` option to change the image - Add recipe description or meal note, default is hidden - Add `showDescription` to toggle the description - Wrap meal name to single line Closes #2
- Add default photo when a photo is not available for a meal plan - Default photo is the Mealie icon - Add `defaultPicture` option to change the image - Add recipe description or meal note, default is hidden - Add `showDescription` to toggle the description - Wrap meal name to single line Closes #2
- Add default photo when a photo is not available for a meal plan - Default photo is the Mealie icon - Add `defaultPicture` option to change the image - Add recipe description or meal note, default is hidden - Add `showDescription` to toggle the description - Wrap meal name to single line Closes #2
# [1.2.0](v1.1.1...v1.2.0) (2024-03-10) ### Features * add default picture, add meal description, fix meal name wrap ([2b2983b](2b2983b)), closes [#2](#2)
🎉 This issue has been resolved in version 1.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Occasionally we make meal plans where some days just use the "Note" feature, rather than linking to a recipe. I created one on our current meal plan, and the
MMM-MealieMenu
module threw an error:It looks like this function is assuming all of the entries will be linked recipes.
These can be added in mealie by toggling the "Note Only" flag:
The text was updated successfully, but these errors were encountered: