2012-01-19 08:01:47 +03:00
|
|
|
using System.Web.Mvc;
|
2011-12-02 04:33:17 +03:00
|
|
|
using NzbDrone.Core.Jobs;
|
2011-05-27 09:03:57 +03:00
|
|
|
using NzbDrone.Web.Models;
|
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
{
|
|
|
|
public class EpisodeController : Controller
|
|
|
|
{
|
|
|
|
private readonly JobProvider _jobProvider;
|
|
|
|
|
|
|
|
public EpisodeController(JobProvider jobProvider)
|
|
|
|
{
|
|
|
|
_jobProvider = jobProvider;
|
|
|
|
}
|
|
|
|
|
2011-08-22 03:48:37 +03:00
|
|
|
[HttpPost]
|
2011-05-27 09:03:57 +03:00
|
|
|
public JsonResult Search(int episodeId)
|
|
|
|
{
|
|
|
|
_jobProvider.QueueJob(typeof(EpisodeSearchJob), episodeId);
|
2012-01-19 08:01:47 +03:00
|
|
|
return JsonNotificationResult.Info("Queued");
|
2011-05-27 09:03:57 +03:00
|
|
|
}
|
|
|
|
|
2011-08-22 03:48:37 +03:00
|
|
|
[HttpPost]
|
|
|
|
public JsonResult SearchSeason(int seriesId, int seasonNumber)
|
|
|
|
{
|
|
|
|
_jobProvider.QueueJob(typeof(SeasonSearchJob), seriesId, seasonNumber);
|
2012-01-19 08:01:47 +03:00
|
|
|
return JsonNotificationResult.Info("Queued");
|
2011-08-22 03:48:37 +03:00
|
|
|
}
|
|
|
|
|
2011-11-26 10:53:16 +03:00
|
|
|
public JsonResult BacklogSeries(int seriesId)
|
2011-08-23 08:29:12 +03:00
|
|
|
{
|
|
|
|
_jobProvider.QueueJob(typeof(SeriesSearchJob), seriesId);
|
2012-01-19 08:01:47 +03:00
|
|
|
return JsonNotificationResult.Info("Queued");
|
2011-08-23 08:29:12 +03:00
|
|
|
}
|
|
|
|
|
2011-06-06 08:23:28 +03:00
|
|
|
public JsonResult Rename(int episodeFileId)
|
|
|
|
{
|
|
|
|
_jobProvider.QueueJob(typeof(RenameEpisodeJob), episodeFileId);
|
2012-01-19 08:01:47 +03:00
|
|
|
return JsonNotificationResult.Info("Queued");
|
2011-06-06 08:23:28 +03:00
|
|
|
}
|
2011-08-22 03:48:37 +03:00
|
|
|
|
|
|
|
public JsonResult RenameSeason(int seriesId, int seasonNumber)
|
|
|
|
{
|
|
|
|
_jobProvider.QueueJob(typeof(RenameSeasonJob), seriesId, seasonNumber);
|
2012-01-19 08:01:47 +03:00
|
|
|
return JsonNotificationResult.Info("Queued");
|
2011-08-22 03:48:37 +03:00
|
|
|
}
|
2011-08-23 08:29:12 +03:00
|
|
|
|
2011-11-26 10:53:16 +03:00
|
|
|
public JsonResult RenameEpisodes(int seriesId)
|
2011-08-23 08:29:12 +03:00
|
|
|
{
|
|
|
|
_jobProvider.QueueJob(typeof(RenameSeriesJob), seriesId);
|
2012-01-19 08:01:47 +03:00
|
|
|
return JsonNotificationResult.Info("Queued");
|
2011-08-23 08:29:12 +03:00
|
|
|
}
|
2011-05-27 09:03:57 +03:00
|
|
|
}
|
|
|
|
}
|