2011-12-02 01:33:17 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System;
|
2011-08-22 00:48:37 +00:00
|
|
|
|
using Ninject;
|
2011-05-26 05:44:59 +00:00
|
|
|
|
using NzbDrone.Core.Model.Notification;
|
2011-12-02 01:33:17 +00:00
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
using NzbDrone.Core.Providers.Jobs;
|
2011-05-26 05:44:59 +00:00
|
|
|
|
|
2011-12-02 01:33:17 +00:00
|
|
|
|
namespace NzbDrone.Core.Jobs
|
2011-05-26 05:44:59 +00:00
|
|
|
|
{
|
|
|
|
|
public class EpisodeSearchJob : IJob
|
|
|
|
|
{
|
2011-08-28 05:45:36 +00:00
|
|
|
|
private readonly SearchProvider _searchProvider;
|
2011-05-26 05:44:59 +00:00
|
|
|
|
|
2011-08-22 00:48:37 +00:00
|
|
|
|
[Inject]
|
2011-08-28 05:45:36 +00:00
|
|
|
|
public EpisodeSearchJob(SearchProvider searchProvider)
|
2011-05-26 05:44:59 +00:00
|
|
|
|
{
|
2011-08-28 05:45:36 +00:00
|
|
|
|
_searchProvider = searchProvider;
|
2011-05-26 05:44:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-08-22 00:48:37 +00:00
|
|
|
|
public EpisodeSearchJob()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-26 05:44:59 +00:00
|
|
|
|
public string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "Episode Search"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int DefaultInterval
|
|
|
|
|
{
|
|
|
|
|
get { return 0; }
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-22 00:48:37 +00:00
|
|
|
|
public virtual void Start(ProgressNotification notification, int targetId, int secondaryTargetId)
|
2011-05-26 05:44:59 +00:00
|
|
|
|
{
|
2011-05-27 03:54:28 +00:00
|
|
|
|
if (targetId <= 0)
|
|
|
|
|
throw new ArgumentOutOfRangeException("targetId");
|
|
|
|
|
|
2011-08-28 05:45:36 +00:00
|
|
|
|
_searchProvider.EpisodeSearch(notification, targetId);
|
2011-05-26 05:44:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|