2019-08-31 22:53:47 +02:00
|
|
|
//
|
|
|
|
// SearchTimelineFeedDelegate.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 8/31/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
2019-09-18 03:26:49 +02:00
|
|
|
import RSCore
|
2019-08-31 22:53:47 +02:00
|
|
|
import Account
|
|
|
|
import Articles
|
2019-12-17 07:45:59 +01:00
|
|
|
import ArticlesDatabase
|
2019-08-31 22:53:47 +02:00
|
|
|
|
|
|
|
struct SearchTimelineFeedDelegate: SmartFeedDelegate {
|
|
|
|
|
2019-11-15 13:19:14 +01:00
|
|
|
var feedID: FeedIdentifier? {
|
|
|
|
return FeedIdentifier.smartFeed(String(describing: SearchTimelineFeedDelegate.self))
|
2019-11-14 22:06:32 +01:00
|
|
|
}
|
|
|
|
|
2019-08-31 22:53:47 +02: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-06 01:05:57 +01:00
|
|
|
var smallIcon: IconImage? = AppAssets.searchFeedImage
|
2019-08-31 22:53:47 +02:00
|
|
|
|
|
|
|
init(searchString: String, articleIDs: Set<String>) {
|
|
|
|
self.searchString = searchString
|
|
|
|
self.fetchType = .searchWithArticleIDs(searchString, articleIDs)
|
|
|
|
}
|
|
|
|
|
2019-12-17 07:45:59 +01:00
|
|
|
func fetchUnreadCount(for: Account, completion: @escaping SingleUnreadCountCompletionBlock) {
|
2019-08-31 22:53:47 +02:00
|
|
|
// TODO: after 5.0
|
|
|
|
}
|
|
|
|
}
|