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.
Prowlarr/NzbDrone.Web/Controllers/SeriesController.cs

129 lines
2.6 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;
14 years ago
//
// GET: /Series/
public SeriesController(ISeriesProvider seriesProvider)
14 years ago
{
_seriesProvider = seriesProvider;
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());
}
14 years ago
//
// GET: /Series/Details/5
public ActionResult Details(int tvdbId)
14 years ago
{
return View(_seriesProvider.GetSeries(tvdbId));
14 years ago
}
//
// GET: /Series/Create
public ActionResult Create()
{
return View();
}
//
// POST: /Series/Create
[HttpPost]
public ActionResult Create(FormCollection collection)
{
try
{
// TODO: Add insert logic here
return RedirectToAction("Index");
}
catch
{
return View();
}
}
//
// GET: /Series/Edit/5
public ActionResult Edit(int id)
{
return View();
}
//
// POST: /Series/Edit/5
[HttpPost]
public ActionResult Edit(int id, FormCollection collection)
{
try
{
// TODO: Add update logic here
return RedirectToAction("Index");
}
catch
{
return View();
}
}
//
// GET: /Series/Delete/5
public ActionResult Delete(int id)
{
return View();
}
//
// POST: /Series/Delete/5
[HttpPost]
public ActionResult Delete(int id, FormCollection collection)
{
try
{
// TODO: Add delete logic here
return RedirectToAction("Index");
}
catch
{
return View();
}
}
}
}