Implementation of recalculation of ingredients #1561
Replies: 5 comments 14 replies
-
Hey @christianlupus Let me answer your questions:
I only want to change the frontend.
I don't want to change the API.
No. The stored recipe stays as it is. The new feature is only usable, if the stored data is in the "correct" format like
The stored recipe contains a number (servings) which tells us how many servings the recipe is for. I want to use this number to dynamically (on the fly) calculate the ingredients based on the servings selector: The „algorithm“ is:
Basically I want to add two buttons There are a few ways how this can be handled:
|
Beta Was this translation helpful? Give feedback.
-
Just saw 0.10.3 with the yield calculator. Very cool! I like the "copy" button for the ingredients list, too. Thank you! One issue I'm seeing is with fractional measurements like ⅓, common in imperial unit cooking (UK, USA, etc). ⅓ now becomes 0.33. There's not a kitchen under the king with a tool labeled "0.33 cup". It's easy to figure out "0.33 cup" is approximately "⅓ cup", but it takes a beat longer to grok an imperial ingredient list when fractions are converted to decimals. And gods help me if I'm trying to make a half recipe with, say "0.17 cup" of something. It's easy with more common decimals. "½ cup" becomes "0.50 cup": sure, no problem. It seems like imperial recipes are just never written out this way. Handling fractions would be pain, I imagine. I blame the monarchy. Side note: I've written some fractions using single "VULGAR FRACTION" non-ASCII characters. ⅓, ¼ instead of 1/3, 1/4, and so on. I see those are not parsed. I blame myself for trying to be too fancy. The unicode database includes numeric values so at least converting to that might be straightforward. On my system if I run I'm happy to file issues for this stuff, just let me know if that would be helpful. |
Beta Was this translation helpful? Give feedback.
-
I find the quantity conversion of the ingredient fields very good. But: Can a code for the beginning of the line (e.g. the existing ##) be taken into account that this line is excluded from the recalculation, that this is a heading line or description line between the ingredients, for which there is also no error message that it cannot be converted? |
Beta Was this translation helpful? Give feedback.
-
Hello Did you have a special caractere to ignore the line (and nat to add the warning aboutr things not calculated with portion) |
Beta Was this translation helpful? Give feedback.
-
Thanks for reply. |
Beta Was this translation helpful? Give feedback.
-
Hello @j0hannesr0th,
after reading your comment, I wanted to separate the technical discussion into a new thread. I also invite @seyfeb and @MarcelRobitaille to participate.
Before I can say if a PR has any good chance of getting merged, I would have some technical details to be hammered out (in concept). Let me ask you a few questions (more will most probably arise):
Thanks for your intention to help here.
Beta Was this translation helpful? Give feedback.
All reactions