From cf855466b34e2962b602fdf062b51c0dd2b3394b Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 5 Apr 2024 18:04:38 -0700 Subject: [PATCH] Delete ArticlesDatabaseCompatibility.swift --- .../ArticlesDatabaseCompatibility.swift | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 ArticlesDatabase/Sources/ArticlesDatabase/ArticlesDatabaseCompatibility.swift diff --git a/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesDatabaseCompatibility.swift b/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesDatabaseCompatibility.swift deleted file mode 100644 index 32f611686..000000000 --- a/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesDatabaseCompatibility.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// ArticlesDatabase.swift -// NetNewsWire -// -// Created by Brent Simmons on 7/20/15. -// Copyright © 2015 Ranchero Software, LLC. All rights reserved. -// - -import Foundation -import Database -import Parser -import Articles - -// This file exists for compatibility — it provides nonisolated functions and callback-based APIs. -// It will go away as we adopt structured concurrency. - -public typealias UpdateArticlesResult = Result -public typealias UpdateArticlesCompletionBlock = @Sendable (UpdateArticlesResult) -> Void - -public typealias ArticleSetResult = Result, DatabaseError> -public typealias ArticleSetResultBlock = (ArticleSetResult) -> Void - -public extension ArticlesDatabase { - - // MARK: - Saving, Updating, and Deleting Articles - - /// Update articles and save new ones — for feed-based systems (local and iCloud). -// nonisolated func update(with parsedItems: Set, feedID: String, deleteOlder: Bool, completion: @escaping UpdateArticlesCompletionBlock) { -// -// Task { -// do { -// let articleChanges = try await update(parsedItems: parsedItems, feedID: feedID, deleteOlder: deleteOlder) -// callUpdateArticlesCompletion(completion, .success(articleChanges)) -// } catch { -// callUpdateArticlesCompletion(completion, .failure(.suspended)) -// } -// } -// } - - /// Update articles and save new ones — for sync systems (Feedbin, Feedly, etc.). -// nonisolated func update(feedIDsAndItems: [String: Set], defaultRead: Bool, completion: @escaping UpdateArticlesCompletionBlock) { -// -// Task { -// do { -// let articleChanges = try await update(feedIDsAndItems: feedIDsAndItems, defaultRead: defaultRead) -// callUpdateArticlesCompletion(completion, .success(articleChanges)) -// } catch { -// callUpdateArticlesCompletion(completion, .failure(.suspended)) -// } -// } -// } - - nonisolated private func callUpdateArticlesCompletion(_ completion: @escaping UpdateArticlesCompletionBlock, _ result: UpdateArticlesResult) { - - Task { @MainActor in - completion(result) - } - } -}