You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/NzbDrone.Web/Controllers/SeriesController.cs

70 lines
1.7 KiB

14 years ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NzbDrone.Core.Providers;
14 years ago
namespace NzbDrone.Web.Controllers
{
public class SeriesController : Controller
{
private readonly ISeriesProvider _seriesProvider;
private readonly IEpisodeProvider _episodeProvider;
14 years ago
//
// GET: /Series/
public SeriesController(ISeriesProvider seriesProvider, IEpisodeProvider episodeProvider)
14 years ago
{
_seriesProvider = seriesProvider;
_episodeProvider = episodeProvider;
14 years ago
}
public ActionResult Index()
{
ViewData.Model = _seriesProvider.GetSeries().ToList();
14 years ago
return View();
}
public ActionResult Sync()
{
_seriesProvider.SyncSeriesWithDisk();
14 years ago
return RedirectToAction("Index");
}
14 years ago
public ActionResult UnMapped()
{
_seriesProvider.SyncSeriesWithDisk();
return View(_seriesProvider.GetUnmappedFolders());
}
public ActionResult LoadEpisodes(int seriesId)
14 years ago
{
_episodeProvider.RefreshSeries(seriesId);
return RedirectToAction("Details", new
14 years ago
{
seriesId = seriesId
});
14 years ago
}
public JsonResult MediaDetect()
{
Core.Providers.IMediaDiscoveryProvider disco = new Core.Providers.MediaDiscoveryProvider();
return Json(new { Discovered = disco.DiscoveredMedia }, JsonRequestBehavior.AllowGet);
}
14 years ago
//
// GET: /Series/Details/5
14 years ago
public ActionResult Details(int seriesId)
14 years ago
{
return View(_seriesProvider.GetSeries(seriesId));
14 years ago
}
}
}