The-Silverwood-Institute/Recibase

Move meals into Recibase

Closed this issue · 2 comments

Support recipe stubs, with a name, tags and an optional URL

Blocked by #170

Script for the migration:

console.log(meals.sort((a, b) => a.name > b.name).map(meal => {
    const scalaTags = meal.tags.map(tag => ({
        "vegetarian": "Tag.Vegetarian",
        "soup": "Tag.Soup",
        "scales": "Tag.Scales",
        "freezes": "Tag.Freezes",
        "better-next-day": "Tag.BetterNextDay",
        "slow": "Tag.Slow",
        "cold-weather": "Tag.ColdWeather",
        "vegan": "Tag.Vegan",
        "vegan-ish": "Tag.VeganIsh",
        "spicy": "Tag.Spicy",
        "stodge": "Tag.Stodge",
        "quick": "Tag.Quick",
        "vegetarian-ish": "Tag.VegetarianIsh",
        "hot-weather": "Tag.HotWeather",
        "effort": "Tag.Effort",
        "pescatarian": "Tag.Pescatarian"
    })[tag]);

    const stringifiedTags = scalaTags.join(", ");

    return `MealStub("${meal.name}", Set(${stringifiedTags}))`;
}).join(",\n"))

Just need to remove the old meals list from the chooser and it's all done