1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00
Sonarr/NzbDrone.Web/Controllers/SeriesController.cs
2010-10-04 23:21:18 -07:00

64 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
{
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));
}
}
}