From f58e4737c0f16bb2e8f540955e9851e79e957a91 Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Thu, 2 Mar 2017 09:23:44 -0500 Subject: [PATCH] Don't display duplicate links when subscribing and use feed URL when title isn't supplied --- Application/MainWindow/FeedCreation.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Application/MainWindow/FeedCreation.cs b/Application/MainWindow/FeedCreation.cs index cb151a1..00dc559 100644 --- a/Application/MainWindow/FeedCreation.cs +++ b/Application/MainWindow/FeedCreation.cs @@ -32,7 +32,8 @@ namespace FeedCenter // Look for all RSS or atom links in the document var rssLinks = htmlDocument.DocumentNode.Descendants("link") .Where(n => n.Attributes["type"] != null && (n.Attributes["type"].Value == "application/rss+xml" || n.Attributes["type"].Value == "application/atom+xml")) - .Select(n => new Tuple(UrlHelper.GetAbsoluteUrlString(feed.Source, n.Attributes["href"].Value), WebUtility.HtmlDecode(n.Attributes["title"]?.Value ?? string.Empty))) + .Select(n => new Tuple(UrlHelper.GetAbsoluteUrlString(feed.Source, n.Attributes["href"].Value), WebUtility.HtmlDecode(n.Attributes["title"]?.Value ?? feedUrl))) + .Distinct() .ToList(); // If there was only one link found then switch to feed to it