2019-07-06 05:06:31 +02:00
|
|
|
//
|
|
|
|
// SmartFeedDelegate.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 6/25/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import Account
|
|
|
|
import Articles
|
2019-12-17 07:45:59 +01:00
|
|
|
import ArticlesDatabase
|
2024-03-11 02:17:04 +01:00
|
|
|
import Database
|
2024-03-21 04:49:15 +01:00
|
|
|
import Core
|
2019-07-06 05:06:31 +02:00
|
|
|
|
2024-02-26 06:17:00 +01:00
|
|
|
protocol SmartFeedDelegate: SidebarItemIdentifiable, DisplayNameProvider, ArticleFetcher, SmallIconProvider {
|
2024-03-19 05:08:37 +01:00
|
|
|
|
2024-03-25 20:48:02 +01:00
|
|
|
@MainActor var fetchType: FetchType { get }
|
2024-03-19 05:08:37 +01:00
|
|
|
|
2024-03-25 20:48:02 +01:00
|
|
|
@MainActor func unreadCount(account: Account) async -> Int
|
2019-07-06 05:06:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
extension SmartFeedDelegate {
|
|
|
|
|
2024-03-19 05:08:37 +01:00
|
|
|
@MainActor func fetchArticles() async throws -> Set<Article> {
|
|
|
|
|
|
|
|
try await AccountManager.shared.fetchArticles(fetchType: fetchType)
|
2019-07-06 05:06:31 +02:00
|
|
|
}
|
|
|
|
|
2024-03-19 05:08:37 +01:00
|
|
|
@MainActor func fetchUnreadArticles() async throws -> Set<Article> {
|
|
|
|
|
|
|
|
try await AccountManager.shared.fetchArticles(fetchType: fetchType)
|
2019-07-06 05:06:31 +02:00
|
|
|
}
|
|
|
|
}
|