mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-11-01 16:32:56 +01:00
350e0388de
JobQueueItem class created instead of using Tuples. Added Search for Season and Rename Season jobs , plus links for them on Series/Details. Add GetSeasonFiles added to MediaFileProvider.
50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
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]
|
|
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);
|
|
|
|
return new JsonResult { Data = "ok" };
|
|
}
|
|
|
|
public JsonResult RenameSeason(int seriesId, int seasonNumber)
|
|
{
|
|
_jobProvider.QueueJob(typeof(RenameSeasonJob), seriesId, seasonNumber);
|
|
|
|
return new JsonResult { Data = "ok" };
|
|
}
|
|
}
|
|
} |