1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-10 21:12:56 +01:00
Radarr/NzbDrone.Web/Controllers/SeriesController.cs

65 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NzbDrone.Core.Providers;
namespace NzbDrone.Web.Controllers
{
[HandleError]
public class SeriesController : Controller
{
private readonly ISeriesProvider _seriesProvider;
private readonly IEpisodeProvider _episodeProvider;
//
// GET: /Series/
public SeriesController(ISeriesProvider seriesProvider, IEpisodeProvider episodeProvider)
{
_seriesProvider = seriesProvider;
_episodeProvider = episodeProvider;
}
public ActionResult Index()
{
ViewData.Model = _seriesProvider.GetSeries().ToList();
return View();
}
public ActionResult Sync()
{
_seriesProvider.SyncSeriesWithDisk();
return RedirectToAction("Index");
}
public ActionResult UnMapped()
{
_seriesProvider.SyncSeriesWithDisk();
return View(_seriesProvider.GetUnmappedFolders());
}
public ActionResult LoadEpisodes(int seriesId)
{
_episodeProvider.RefreshSeries(seriesId);
return RedirectToAction("Details", new
{
seriesId = seriesId
});
}
//
// GET: /Series/Details/5
public ActionResult Details(int seriesId)
{
return View(_seriesProvider.GetSeries(seriesId));
}
}
}