WIP - Complete App refactoring
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user