Avoid reusing category thumbnail images in all recipes preview mosaic
Track which recipe IDs are used as category thumbnails and prefer different images for the all recipes 2x2 mosaic, falling back to category thumbnails only when not enough other images are available. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ import UIKit
|
||||
@Published var recipeDetails: [Int: RecipeDetail] = [:]
|
||||
@Published var timers: [String: RecipeTimer] = [:]
|
||||
@Published var categoryImages: [String: UIImage] = [:]
|
||||
@Published var categoryImageRecipeIds: Set<Int> = []
|
||||
@Published var recentRecipes: [Recipe] = []
|
||||
@Published var categoryAccessDates: [String: Date] = [:]
|
||||
@Published var manualCategoryOrder: [String] = []
|
||||
@@ -320,6 +321,7 @@ import UIKit
|
||||
for recipe in recipes {
|
||||
if let image = await getImage(id: recipe.recipe_id, size: .THUMB, fetchMode: .preferLocal) {
|
||||
self.categoryImages[categoryName] = image
|
||||
self.categoryImageRecipeIds.insert(recipe.recipe_id)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user