Skip to content
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

[Task] ⚖️ Recipe Ingredient Scaling #507

Closed
12 of 14 tasks
hay-kot opened this issue Jun 13, 2021 · 6 comments · Fixed by #1143
Closed
12 of 14 tasks

[Task] ⚖️ Recipe Ingredient Scaling #507

hay-kot opened this issue Jun 13, 2021 · 6 comments · Fixed by #1143
Labels
task General Task that needs to be completed

Comments

@hay-kot
Copy link
Collaborator

hay-kot commented Jun 13, 2021

Description: Add support for ingredients.

Checklist:

  • Backend:
    • Add Database Layer
    • Add New Schema
    • Auto Generate Basic Set of Units on database init
    • Auto Scrape string to units/food
    • CRUD routes for Foods and Units
    • Add Merge Foods supports
    • Add Merge Units support
    • Update API Docs/Schema in Pydantic Model
  • Frontend
    • Set Frontend to Expect Objects
    • Add Units/Food CRUD User Interface (Including Merge)
    • Rewrite Ingredients Editor
    • Add Support for Ingredient Sections w/ Title Attribute (See how Instruction sections works)

Relevant PRs:

#506 - Add Database Layer to Support Scaling - @hay-kot

@hay-kot
Copy link
Collaborator Author

hay-kot commented Jun 13, 2021

I've gone through and added the database layer for the required fields. There is both a Foods and Units field where the foods are things like Carrots or Onions and Units are like Cups or Oz. I've also added the following behavior

  • When creating a Recipe Pydantic Model if it's a list of strings it will be converted to the new schema by passing the string as the notes field. This will allow backups/restores to happen seamlessly.
  • By default, all ingredients default to amount_disabled=True this behavior results in only the notes section being shown. This will retain the simplicity for users who don't care about recipe scaling.
  • Shopping lists now pull the notes field out of the ingredient. This will need to change in the future. Likely a whole rewrite of the shopping list is necessary to provide adequate merging of ingredients.
  • I've also generated some skeleton routes that don't do anything yet for the Food/Units that will be required for the CRUD functionality through the API.

I'm going to be leaving this for a while to work on tests but this should be a good starting point.

@hay-kot hay-kot added the task General Task that needs to be completed label Jun 13, 2021
@zierbeek
Copy link
Contributor

Is it considered that we would like halve the recipe. currently, if a cake is made for example, with 8 portions. There is no option to scale it down to let's say 6 servings. Although, this is only a rule of three.

@hay-kot
Copy link
Collaborator Author

hay-kot commented Mar 22, 2022

@zierbeek that's not a use case I'm considering.

@Sennevds
Copy link

@hay-kot I have the same request. But it's already said in the discord. Several people use it for non baking and there it's logical that you can scale down or up with a increment of one. Maybe an option to add to a recipe that it can be scaled down or something?

@mjmccans
Copy link

For what it is worth, I too would really appreciate being able to scale below one or be able to scale up by a fraction (e.g., 1.5 the recipe). I am not a great cook so I may be missing reasons why this would not work, but I often scale my recipes by fractional amounts and allowing this feature would save me doing some math. Either way, I am really enjoying the program and thank you for all of the effort!

@hay-kot hay-kot linked a pull request Apr 10, 2022 that will close this issue
@hay-kot
Copy link
Collaborator Author

hay-kot commented Apr 10, 2022

Hey folks, closing this issue since the initial support is now baked into Mealie v1. As far as the scaling down - it's not something I'm going to look at but happy to look at a feature request and/or a PR to add it.

@hay-kot hay-kot closed this as completed Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task General Task that needs to be completed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants