2011-12-02 04:33:17 +03:00
|
|
|
using System.Linq;
|
|
|
|
using System;
|
2011-05-26 08:44:59 +03:00
|
|
|
using NzbDrone.Core.Model.Notification;
|
2011-12-02 04:33:17 +03:00
|
|
|
using NzbDrone.Core.Providers;
|
2011-05-26 08:44:59 +03:00
|
|
|
|
2011-12-02 04:33:17 +03:00
|
|
|
namespace NzbDrone.Core.Jobs
|
2011-05-26 08:44:59 +03:00
|
|
|
{
|
|
|
|
public class EpisodeSearchJob : IJob
|
|
|
|
{
|
2011-08-28 08:45:36 +03:00
|
|
|
private readonly SearchProvider _searchProvider;
|
2011-05-26 08:44:59 +03:00
|
|
|
|
2011-08-28 08:45:36 +03:00
|
|
|
public EpisodeSearchJob(SearchProvider searchProvider)
|
2011-05-26 08:44:59 +03:00
|
|
|
{
|
2011-08-28 08:45:36 +03:00
|
|
|
_searchProvider = searchProvider;
|
2011-05-26 08:44:59 +03:00
|
|
|
}
|
|
|
|
|
2011-08-22 03:48:37 +03:00
|
|
|
public EpisodeSearchJob()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-05-26 08:44:59 +03:00
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get { return "Episode Search"; }
|
|
|
|
}
|
|
|
|
|
2012-01-15 05:47:23 +03:00
|
|
|
public TimeSpan DefaultInterval
|
2011-05-26 08:44:59 +03:00
|
|
|
{
|
2012-01-15 05:47:23 +03:00
|
|
|
get { return TimeSpan.FromTicks(0); }
|
2011-05-26 08:44:59 +03:00
|
|
|
}
|
|
|
|
|
2012-09-10 22:04:17 +03:00
|
|
|
public virtual void Start(ProgressNotification notification, dynamic options)
|
2011-05-26 08:44:59 +03:00
|
|
|
{
|
2012-09-10 22:04:17 +03:00
|
|
|
if (options == null || options.EpisodeId <= 0)
|
|
|
|
throw new ArgumentException("options");
|
2011-05-27 06:54:28 +03:00
|
|
|
|
2012-09-10 22:04:17 +03:00
|
|
|
_searchProvider.EpisodeSearch(notification, options.EpisodeId);
|
2011-05-26 08:44:59 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|