Make recipe yield for grocery list a parameter
This commit is contained in:
parent
1d5faae1f6
commit
b2a03ab080
2 changed files with 8 additions and 3 deletions
|
@ -19,6 +19,7 @@ pub async fn with(
|
|||
location: &str,
|
||||
start_date: Option<NaiveDate>,
|
||||
days: u32,
|
||||
required_yield: f64,
|
||||
) -> Result<()> {
|
||||
use chrono::{NaiveDateTime, NaiveTime, TimeZone};
|
||||
let start = start_date
|
||||
|
@ -34,9 +35,7 @@ pub async fn with(
|
|||
};
|
||||
|
||||
let ids = map_events_to_recipe_ids(api_client, calendar_name, &date_range).await?;
|
||||
|
||||
// TODO: make required_yield configurable!
|
||||
let ingredients = get_ingredients(api_client, ids, 4.0).await?;
|
||||
let ingredients = get_ingredients(api_client, ids, required_yield).await?;
|
||||
let ingredients = merge_ingredients(ingredients);
|
||||
let md = prepare_grocery_list(&date_range, &ingredients)?;
|
||||
log::debug!("Saving the following grocery list:\n\n{}", &md);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue