2013-03-04 21:37:33 -08:00
|
|
|
using System;
|
2013-02-23 22:48:52 -08:00
|
|
|
using NzbDrone.Core.Configuration;
|
2013-02-20 23:07:34 -08:00
|
|
|
using NzbDrone.Core.Indexers;
|
2011-04-20 00:44:13 -07:00
|
|
|
using NzbDrone.Core.Model.Notification;
|
2011-04-19 18:20:20 -07:00
|
|
|
|
2013-03-04 21:37:33 -08:00
|
|
|
namespace NzbDrone.Core.Jobs.Implementations
|
2011-04-19 18:20:20 -07:00
|
|
|
{
|
2011-04-20 00:44:13 -07:00
|
|
|
public class RssSyncJob : IJob
|
2011-04-19 18:20:20 -07:00
|
|
|
{
|
2013-04-07 00:30:37 -07:00
|
|
|
private readonly ISyncRss _syncRssService;
|
2013-02-23 22:48:52 -08:00
|
|
|
private readonly IConfigService _configService;
|
2011-04-21 23:23:29 -07:00
|
|
|
|
2011-04-19 18:20:20 -07:00
|
|
|
|
2013-04-07 00:30:37 -07:00
|
|
|
public RssSyncJob(ISyncRss syncRssService, IConfigService configService)
|
2011-04-19 18:20:20 -07:00
|
|
|
{
|
2013-04-07 00:30:37 -07:00
|
|
|
_syncRssService = syncRssService;
|
2013-02-23 22:48:52 -08:00
|
|
|
_configService = configService;
|
2011-04-19 18:20:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get { return "RSS Sync"; }
|
|
|
|
}
|
|
|
|
|
2012-01-14 18:47:23 -08:00
|
|
|
public TimeSpan DefaultInterval
|
2011-04-19 18:20:20 -07:00
|
|
|
{
|
2013-02-23 22:48:52 -08:00
|
|
|
get { return TimeSpan.FromMinutes(_configService.RssSyncInterval); }
|
2011-04-19 18:20:20 -07:00
|
|
|
}
|
|
|
|
|
2012-09-10 12:04:17 -07:00
|
|
|
public void Start(ProgressNotification notification, dynamic options)
|
2011-04-19 18:20:20 -07:00
|
|
|
{
|
2013-04-07 00:30:37 -07:00
|
|
|
_syncRssService.Sync();
|
2011-04-19 18:20:20 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|