From 3262a7a8fc21d8ed57d611d36da1666cae4ee6a3 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 11 Feb 2018 16:19:53 -0800 Subject: [PATCH] Skip downloading feeds for the Feed Directory, since feed previews have been punted to after 1.0. --- Evergreen/FeedList/FeedListFeed.swift | 58 ++++++++++++++------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/Evergreen/FeedList/FeedListFeed.swift b/Evergreen/FeedList/FeedListFeed.swift index 017f32bfb..80968687b 100644 --- a/Evergreen/FeedList/FeedListFeed.swift +++ b/Evergreen/FeedList/FeedListFeed.swift @@ -62,15 +62,17 @@ final class FeedListFeed: Hashable, DisplayNameProvider { func downloadIfNeeded() { - guard let lastDownloadAttemptDate = lastDownloadAttemptDate else { - downloadFeed() - return - } + // Not doing feed previews until after 1.0. - let cutoffDate = Date().addingTimeInterval(-(30 * 60)) // 30 minutes in the past - if lastDownloadAttemptDate < cutoffDate { - downloadFeed() - } +// guard let lastDownloadAttemptDate = lastDownloadAttemptDate else { +// downloadFeed() +// return +// } +// +// let cutoffDate = Date().addingTimeInterval(-(30 * 60)) // 30 minutes in the past +// if lastDownloadAttemptDate < cutoffDate { +// downloadFeed() +// } } static func ==(lhs: FeedListFeed, rhs: FeedListFeed) -> Bool { @@ -83,29 +85,29 @@ private extension FeedListFeed { func postFeedListFeedDidBecomeAvailableNotification() { - NotificationCenter.default.post(name: .FeedListFeedDidBecomeAvailable, object: self, userInfo: nil) +// NotificationCenter.default.post(name: .FeedListFeedDidBecomeAvailable, object: self, userInfo: nil) } func downloadFeed() { - lastDownloadAttemptDate = Date() - guard let feedURL = URL(string: url) else { - return - } - - downloadUsingCache(feedURL) { (data, response, error) in - - guard let data = data, error == nil else { - return - } - - let parserData = ParserData(url: self.url, data: data) - FeedParser.parse(parserData) { (parsedFeed, error) in - - if let parsedFeed = parsedFeed, parsedFeed.items.count > 0 { - self.parsedFeed = parsedFeed - } - } - } +// lastDownloadAttemptDate = Date() +// guard let feedURL = URL(string: url) else { +// return +// } +// +// downloadUsingCache(feedURL) { (data, response, error) in +// +// guard let data = data, error == nil else { +// return +// } +// +// let parserData = ParserData(url: self.url, data: data) +// FeedParser.parse(parserData) { (parsedFeed, error) in +// +// if let parsedFeed = parsedFeed, parsedFeed.items.count > 0 { +// self.parsedFeed = parsedFeed +// } +// } +// } } }