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