Bug: scraping the same ingredient several times in the same recipe is only partially transferred
Is this urgent?
No
What parts are affected
Frontend
What is the server version
v109
What is the client version
v0.6.11
What platform are you using
Linux
What's the problem 🤔
When scraping the Chinese Pork Bun, "water" appears multiple times in the scraping menu
In total, the recipe should have 190 ml + 1/2 cup of water. However, when finishing the scraping only 125ml are taken over:
Share your logs
Share your configuration
@TomBursch The reason for this is that currently the primary keys of RecipeItems are recipe_id and item_id, right?
I see two possible solutions, maybe you see more:
A Totally loosing the primary-key-constraint for item-id. B ingredient-groups as third primary-key, e.g. “dough” or “filling”.
I favor for nothing really, however would appreciate having ingredient-groups and started working on it recently, but it's more work than expected 😄 . Both solutions would mean that the markdown-logic would have to be reworked, I think. Also, if not all ingredients will be included in the recipe after parsing, a warning should appear but this is a new issue.
ingredient-groups as third primary-key
I'm not sure if I like user entered strings as part of the primary key. This makes dealing with renaming the group and such a bit annoying.
Totally loosing the primary-key-constraint for item-id.
We could introduce an auto-incrementing integer primary key and only index the (item-id, recipe-id). This would allow adding the same ingredient multiple times to a recipe. Is that good or bad? But it would also fix #286 #615
(Also sorry I didn't respond to your mock-up, feel free to ping me or send a message on matrix if you want me to look at it)
Don't apologize. This is an open source project, we're here for fun...
And I think you're right. I will try to setup a draft the next days so we can test it. If you don't hear anything about it from me, feel free to take over 😉
Scraping wouldn't be the problem, but the current add-Items-to-Recipe-UI is not that trivial to change. However, with a few changes to SliverItemGridList it seems possible. The most straightforward UI would be adding a selectable copy of each selected Item, like follows:
The user selected Banana, so a second selectable Banana showed up.