mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-13 17:22:48 -05:00
Don't display duplicate links when subscribing and use feed URL when title isn't supplied
This commit is contained in:
@@ -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<string, string>(UrlHelper.GetAbsoluteUrlString(feed.Source, n.Attributes["href"].Value), WebUtility.HtmlDecode(n.Attributes["title"]?.Value ?? string.Empty)))
|
||||
.Select(n => new Tuple<string, string>(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
|
||||
|
||||
Reference in New Issue
Block a user