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

64 lines
1.5 KiB
C#
Raw Normal View History

2010-09-23 06:19:47 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NzbDrone.Core.Providers;
2010-09-23 06:19:47 +03:00
namespace NzbDrone.Web.Controllers
{
public class SeriesController : Controller
{
private readonly ISeriesProvider _seriesProvider;
2010-10-05 09:21:18 +03:00
private readonly IEpisodeProvider _episodeProvider;
2010-09-23 06:19:47 +03:00
//
// GET: /Series/
2010-10-05 09:21:18 +03:00
public SeriesController(ISeriesProvider seriesProvider, IEpisodeProvider episodeProvider)
2010-09-23 06:19:47 +03:00
{
_seriesProvider = seriesProvider;
2010-10-05 09:21:18 +03:00
_episodeProvider = episodeProvider;
2010-09-23 06:19:47 +03:00
}
public ActionResult Index()
{
ViewData.Model = _seriesProvider.GetSeries().ToList();
2010-09-23 06:19:47 +03:00
return View();
}
public ActionResult Sync()
{
_seriesProvider.SyncSeriesWithDisk();
2010-09-23 06:19:47 +03:00
return RedirectToAction("Index");
}
2010-10-02 22:01:43 +03:00
public ActionResult UnMapped()
{
_seriesProvider.SyncSeriesWithDisk();
return View(_seriesProvider.GetUnmappedFolders());
}
2010-10-05 09:21:18 +03:00
public ActionResult LoadEpisodes(int seriesId)
2010-09-23 06:19:47 +03:00
{
2010-10-05 09:21:18 +03:00
_episodeProvider.RefreshSeries(seriesId);
return RedirectToAction("Details", new
2010-09-23 06:19:47 +03:00
{
2010-10-05 09:21:18 +03:00
seriesId = seriesId
});
2010-09-23 06:19:47 +03:00
}
//
2010-10-05 09:21:18 +03:00
// GET: /Series/Details/5
2010-09-23 06:19:47 +03:00
2010-10-05 09:21:18 +03:00
public ActionResult Details(int seriesId)
2010-09-23 06:19:47 +03:00
{
2010-10-05 09:21:18 +03:00
return View(_seriesProvider.GetSeries(seriesId));
2010-09-23 06:19:47 +03:00
}
}
}