mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-30 19:45:57 +00:00
50 lines
No EOL
1.5 KiB
C#
50 lines
No EOL
1.5 KiB
C#
using System;
|
|
using System.Web.Mvc;
|
|
using NzbDrone.Core.Jobs;
|
|
using NzbDrone.Web.Models;
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
{
|
|
public class EpisodeController : Controller
|
|
{
|
|
private readonly JobProvider _jobProvider;
|
|
|
|
public EpisodeController(JobProvider jobProvider)
|
|
{
|
|
_jobProvider = jobProvider;
|
|
}
|
|
|
|
public JsonResult Search(int episodeId)
|
|
{
|
|
_jobProvider.QueueJob(typeof(EpisodeSearchJob), episodeId);
|
|
return JsonNotificationResult.Queued("Episode search");
|
|
}
|
|
|
|
public JsonResult SearchSeason(int seriesId, int seasonNumber)
|
|
{
|
|
_jobProvider.QueueJob(typeof(SeasonSearchJob), seriesId, seasonNumber);
|
|
return JsonNotificationResult.Queued("Season search");
|
|
|
|
}
|
|
|
|
public JsonResult BacklogSeries(int seriesId)
|
|
{
|
|
_jobProvider.QueueJob(typeof(SeriesSearchJob), seriesId);
|
|
return JsonNotificationResult.Queued("Series Backlog");
|
|
|
|
}
|
|
|
|
public JsonResult RenameSeason(int seriesId, int seasonNumber)
|
|
{
|
|
_jobProvider.QueueJob(typeof(RenameSeasonJob), seriesId, seasonNumber);
|
|
return JsonNotificationResult.Queued("Season rename");
|
|
|
|
}
|
|
|
|
public JsonResult RenameEpisodes(int seriesId)
|
|
{
|
|
_jobProvider.QueueJob(typeof(RenameSeriesJob), seriesId);
|
|
return JsonNotificationResult.Queued("Series rename");
|
|
}
|
|
}
|
|
} |