Radarr/NzbDrone.Web/Controllers/EpisodeController.cs

50 lines
1.3 KiB
C#
Raw Normal View History

2011-05-27 06:03:57 +00:00
using System;
using System.Collections.Generic;
using System.IO;
using System.Web.Mvc;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Providers.Jobs;
using NzbDrone.Web.Models;
namespace NzbDrone.Web.Controllers
{
public class EpisodeController : Controller
{
private readonly JobProvider _jobProvider;
public EpisodeController(JobProvider jobProvider)
{
_jobProvider = jobProvider;
}
[HttpPost]
2011-05-27 06:03:57 +00:00
public JsonResult Search(int episodeId)
{
_jobProvider.QueueJob(typeof(EpisodeSearchJob), episodeId);
return new JsonResult { Data = "ok" };
}
[HttpPost]
public JsonResult SearchSeason(int seriesId, int seasonNumber)
{
_jobProvider.QueueJob(typeof(SeasonSearchJob), seriesId, seasonNumber);
return new JsonResult { Data = "ok" };
}
public JsonResult Rename(int episodeFileId)
{
_jobProvider.QueueJob(typeof(RenameEpisodeJob), episodeFileId);
2011-05-27 06:03:57 +00:00
return new JsonResult { Data = "ok" };
}
public JsonResult RenameSeason(int seriesId, int seasonNumber)
{
_jobProvider.QueueJob(typeof(RenameSeasonJob), seriesId, seasonNumber);
return new JsonResult { Data = "ok" };
}
2011-05-27 06:03:57 +00:00
}
}