2019-08-31 15:53:47 -05:00
|
|
|
//
|
|
|
|
// SearchTimelineFeedDelegate.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 8/31/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import Account
|
|
|
|
import Articles
|
2019-12-16 22:45:59 -08:00
|
|
|
import ArticlesDatabase
|
2024-04-15 22:21:17 -07:00
|
|
|
import Images
|
2019-08-31 15:53:47 -05:00
|
|
|
|
2024-04-02 22:26:16 -07:00
|
|
|
@MainActor struct SearchTimelineFeedDelegate: SmartFeedDelegate {
|
2019-08-31 15:53:47 -05:00
|
|
|
|
2024-02-25 21:34:22 -08:00
|
|
|
var sidebarItemID: SidebarItemIdentifier? {
|
2024-02-25 21:17:00 -08:00
|
|
|
return SidebarItemIdentifier.smartFeed(String(describing: SearchTimelineFeedDelegate.self))
|
2019-11-14 15:06:32 -06:00
|
|
|
}
|
|
|
|
|
2019-08-31 15:53:47 -05:00
|
|
|
var nameForDisplay: String {
|
|
|
|
return nameForDisplayPrefix + searchString
|
|
|
|
}
|
|
|
|
|
|
|
|
let nameForDisplayPrefix = NSLocalizedString("Search: ", comment: "Search smart feed title prefix")
|
|
|
|
let searchString: String
|
|
|
|
let fetchType: FetchType
|
2019-11-05 18:05:57 -06:00
|
|
|
var smallIcon: IconImage? = AppAssets.searchFeedImage
|
2019-08-31 15:53:47 -05:00
|
|
|
|
|
|
|
init(searchString: String, articleIDs: Set<String>) {
|
|
|
|
self.searchString = searchString
|
|
|
|
self.fetchType = .searchWithArticleIDs(searchString, articleIDs)
|
|
|
|
}
|
|
|
|
|
2024-03-24 18:49:39 -07:00
|
|
|
func unreadCount(account: Account) async -> Int {
|
|
|
|
|
|
|
|
return 0
|
2019-08-31 15:53:47 -05:00
|
|
|
}
|
|
|
|
}
|