Preparing search index...

    Function generateHomeRecommendations

    • Generates smart recommendations for the home screen

      Creates diverse recipe recommendations using various filtering strategies including random selection, seasonal filtering, ingredient-based filtering, and tag-based filtering. Respects user preferences for seasonal filtering.

      Parameters

      • recipes: recipeTableElement[]

        Array of all recipes to generate recommendations from

      • ingredients: ingredientTableElement[]

        Array of all ingredients for ingredient-based recommendations

      • tags: tagTableElement[]

        Array of all tags for tag-based recommendations

      • seasonFilterEnabled: boolean

        Whether the user has global seasonal filtering enabled

      • recipesPerRecommendation: number

        Number of recipes per recommendation (default: 20)

      Returns RecommendationType[]

      Array of recommendation objects with titles and recipes

      const recommendations = generateHomeRecommendations(
      allRecipes,
      allIngredients,
      allTags,
      false,
      20
      );
      console.log(`Generated ${recommendations.length} recommendations`);