WIP - Complete App refactoring

This commit is contained in:
VincentMeilinger
2025-05-26 15:52:24 +02:00
parent 29fd3c668b
commit 5acf3b9c4f
49 changed files with 1996 additions and 543 deletions

View File

@@ -11,7 +11,7 @@ import SwiftUI
class RecipeScraper {
func scrape(url: String) async throws -> (RecipeDetail?, RecipeImportAlert?) {
func scrape(url: String) async throws -> (CookbookApiRecipeDetailV1?, RecipeImportAlert?) {
var contents: String? = nil
if let url = URL(string: url) {
do {
@@ -77,9 +77,9 @@ class RecipeScraper {
}
}
private func getRecipe(fromDict recipe: Dictionary<String, Any>) -> RecipeDetail? {
private func getRecipe(fromDict recipe: Dictionary<String, Any>) -> CookbookApiRecipeDetailV1? {
var recipeDetail = RecipeDetail()
var recipeDetail = CookbookApiRecipeDetailV1()
recipeDetail.name = recipe["name"] as? String ?? "New Recipe"
recipeDetail.recipeCategory = recipe["recipeCategory"] as? String ?? ""
recipeDetail.keywords = joinedStringForKey("keywords", dict: recipe)