2020-01-09 06:24:47 +01:00
|
|
|
//
|
|
|
|
// FeedlyFetchIdsForMissingArticlesOperation.swift
|
|
|
|
// Account
|
|
|
|
//
|
|
|
|
// Created by Kiel Gillard on 7/1/20.
|
|
|
|
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import os.log
|
|
|
|
|
|
|
|
final class FeedlyFetchIdsForMissingArticlesOperation: FeedlyOperation, FeedlyEntryIdentifierProviding {
|
2020-01-19 23:19:06 +01:00
|
|
|
|
2020-01-09 06:24:47 +01:00
|
|
|
private let account: Account
|
|
|
|
private let log: OSLog
|
|
|
|
|
|
|
|
private(set) var entryIds = Set<String>()
|
|
|
|
|
|
|
|
init(account: Account, log: OSLog) {
|
|
|
|
self.account = account
|
|
|
|
self.log = log
|
|
|
|
}
|
|
|
|
|
2020-01-16 06:30:37 +01:00
|
|
|
override func run() {
|
2020-01-09 06:24:47 +01:00
|
|
|
account.fetchArticleIDsForStatusesWithoutArticlesNewerThanCutoffDate { result in
|
|
|
|
switch result {
|
|
|
|
case .success(let articleIds):
|
|
|
|
self.entryIds.formUnion(articleIds)
|
|
|
|
self.didFinish()
|
|
|
|
|
|
|
|
case .failure(let error):
|
2020-01-19 23:19:06 +01:00
|
|
|
self.didFinish(with: error)
|
2020-01-09 06:24:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|