From c237aed5b8a93c55f4133a4615cb19bf17f0eafb Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 21 Oct 2017 16:23:51 -0700 Subject: [PATCH] =?UTF-8?q?Rejigger=20the=20find-feed=20scoring=20to=20han?= =?UTF-8?q?dle=20bitsplitting.org=20=E2=80=94=C2=A0we=20were=20getting=20t?= =?UTF-8?q?he=20podcast=20feed=20just=20because=20it=20had=20=E2=80=9CRSS?= =?UTF-8?q?=E2=80=9D=20in=20the=20title.=20But=20we=20want=20the=20blog=20?= =?UTF-8?q?feed=20to=20get=20the=20best=20score.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RSFeedFinder/RSFeedFinder/FeedSpecifier.swift | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Frameworks/RSFeedFinder/RSFeedFinder/FeedSpecifier.swift b/Frameworks/RSFeedFinder/RSFeedFinder/FeedSpecifier.swift index 710ae5939..7ff6fa77e 100644 --- a/Frameworks/RSFeedFinder/RSFeedFinder/FeedSpecifier.swift +++ b/Frameworks/RSFeedFinder/RSFeedFinder/FeedSpecifier.swift @@ -63,7 +63,7 @@ public struct FeedSpecifier: Hashable { } var currentHighScore = 0 - var currentBestFeed = feedSpecifiers.anyObject() + var currentBestFeed: FeedSpecifier? = nil for oneFeedSpecifier in feedSpecifiers { let oneScore = oneFeedSpecifier.score @@ -96,9 +96,6 @@ private extension FeedSpecifier { if urlString.rs_caseInsensitiveContains("rss") { score = score + 5 } - if urlString.rs_caseInsensitiveContains("atom") { - score = score - 5 - } if urlString.hasSuffix("/feed/") { score = score + 5 } @@ -110,12 +107,6 @@ private extension FeedSpecifier { if title.rs_caseInsensitiveContains("comments") { score = score - 10 } - if title.rs_caseInsensitiveContains("rss") { - score = score + 10 - } - if title.rs_caseInsensitiveContains("atom") { - score = score - 5 - } } return score