You've already forked Sonarr
mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-11-06 09:19:38 +02:00
removed most of existing rss code
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Model;
|
||||
using Rss;
|
||||
|
||||
namespace NzbDrone.Core.Providers.Core
|
||||
{
|
||||
public interface IRssProvider
|
||||
{
|
||||
IEnumerable<RssItem> GetFeed(FeedInfoModel feedInfo);
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Model;
|
||||
using Rss;
|
||||
|
||||
namespace NzbDrone.Core.Providers.Core
|
||||
{
|
||||
public class RssProvider : IRssProvider
|
||||
{
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#region IRssProvider Members
|
||||
public IEnumerable<RssItem> GetFeed(FeedInfoModel feedInfo)
|
||||
{
|
||||
RssFeed feed = null;
|
||||
try
|
||||
{
|
||||
Logger.Info("INFO: Downloading feed {0} from {1}", feedInfo.Name, feedInfo.Url);
|
||||
feed = RssFeed.Read(feedInfo.Url);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.ErrorException(String.Format("ERROR: Could not download feed {0} from {1}", feedInfo.Name, feedInfo.Url), e);
|
||||
}
|
||||
if (feed == null || feed.Channels == null || feed.Channels.Count == 0)
|
||||
return Enumerable.Empty<RssItem>();
|
||||
return feed.Channels[0].Items.Cast<RssItem>();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user