Sonarr/NzbDrone.Web/Controllers/SeriesController.cs

122 lines
2.4 KiB
C#
Raw Normal View History

2010-09-23 03:19:47 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NzbDrone.Core.Controllers;
namespace NzbDrone.Web.Controllers
{
public class SeriesController : Controller
{
private readonly ISeriesController _seriesController;
//
// GET: /Series/
public SeriesController(ISeriesController seriesController)
{
_seriesController = seriesController;
}
public ActionResult Index()
{
ViewData.Model = _seriesController.GetSeries().ToList();
return View();
}
public ActionResult Sync()
{
_seriesController.SyncSeriesWithDisk();
return RedirectToAction("Index");
}
//
// GET: /Series/Details/5
2010-09-24 07:14:42 +00:00
public ActionResult Details(int tvdbId)
2010-09-23 03:19:47 +00:00
{
2010-09-24 07:14:42 +00:00
return View(_seriesController.GetSeries(tvdbId));
2010-09-23 03:19:47 +00:00
}
//
// 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();
}
}
}
}