mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-12 11:15:43 +02:00
fd32a04d45
Added system/config ui rss job only runs enabled jobs fixed wrong mappings for indexers in settingscontroller
39 lines
924 B
C#
39 lines
924 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using NLog;
|
|
using NzbDrone.Core.Model.Notification;
|
|
using NzbDrone.Core.Providers.Indexer;
|
|
|
|
namespace NzbDrone.Core.Providers.Jobs
|
|
{
|
|
public class RssSyncJob : IJob
|
|
{
|
|
private readonly IEnumerable<IndexerProviderBase> _indexers;
|
|
|
|
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
public RssSyncJob(IEnumerable<IndexerProviderBase> indexers)
|
|
{
|
|
_indexers = indexers;
|
|
}
|
|
|
|
public string Name
|
|
{
|
|
get { return "RSS Sync"; }
|
|
}
|
|
|
|
public int DefaultInterval
|
|
{
|
|
get { return 15; }
|
|
}
|
|
|
|
public void Start(ProgressNotification notification, int targetId)
|
|
{
|
|
foreach (var indexer in _indexers.Where(i => i.Settings.Enable))
|
|
{
|
|
indexer.Fetch();
|
|
}
|
|
}
|
|
}
|
|
} |