2011-04-22 09:23:29 +03:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
2011-04-20 04:20:20 +03:00
|
|
|
using NLog;
|
2011-04-20 10:44:13 +03:00
|
|
|
using NzbDrone.Core.Model.Notification;
|
2011-04-22 09:23:29 +03:00
|
|
|
using NzbDrone.Core.Providers.Indexer;
|
2011-04-20 04:20:20 +03:00
|
|
|
|
2011-04-20 10:44:13 +03:00
|
|
|
namespace NzbDrone.Core.Providers.Jobs
|
2011-04-20 04:20:20 +03:00
|
|
|
{
|
2011-04-20 10:44:13 +03:00
|
|
|
public class RssSyncJob : IJob
|
2011-04-20 04:20:20 +03:00
|
|
|
{
|
2011-04-22 09:23:29 +03:00
|
|
|
private readonly IEnumerable<IndexerProviderBase> _indexers;
|
|
|
|
|
2011-04-20 04:20:20 +03:00
|
|
|
|
|
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
2011-04-22 09:23:29 +03:00
|
|
|
public RssSyncJob(IEnumerable<IndexerProviderBase> indexers)
|
2011-04-20 04:20:20 +03:00
|
|
|
{
|
2011-04-22 09:23:29 +03:00
|
|
|
_indexers = indexers;
|
2011-04-20 04:20:20 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get { return "RSS Sync"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public int DefaultInterval
|
|
|
|
{
|
|
|
|
get { return 15; }
|
|
|
|
}
|
|
|
|
|
2011-04-20 10:44:13 +03:00
|
|
|
public void Start(ProgressNotification notification, int targetId)
|
2011-04-20 04:20:20 +03:00
|
|
|
{
|
2011-04-22 09:23:29 +03:00
|
|
|
foreach (var indexer in _indexers)
|
2011-04-20 04:20:20 +03:00
|
|
|
{
|
2011-04-22 09:23:29 +03:00
|
|
|
indexer.Fetch();
|
2011-04-20 04:20:20 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|