private IEnumerable<RssItem> GetFeedItems(FeedInfo feedInfo) { RssFeed feed = null; try { Log("INFO: Downloading feed {0} from {1}", feedInfo.Name, feedInfo.Url); feed = RssFeed.Read(feedInfo.Url); } catch (Exception e) { Logger.Log("ERROR: Could not download feed {0} from {1}", feedInfo.Name, feedInfo.Url); Logger.Log("ERROR: {0}", e); } if (feed == null || feed.Channels == null || feed.Channels.Count == 0) return Enumerable.Empty<RssItem>(); return feed.Channels[0].Items.Cast<RssItem>(); }
private static NzbInfo ParseNzbInfo(FeedInfo feed, RssItem item) { NzbSite site = NzbSite.Parse(feed.Url.ToLower()); return new NzbInfo { Id = site.ParseId(item.Link.ToString()), Title = item.Title, Site = site, Link = item.Link, Description = item.Description, }; }
public bool Equals(FeedInfo other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.Name, Name) && Equals(other.Url, Url); }