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