1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00
Sonarr/NzbDrone.Web/Controllers/SettingsController.cs
2010-09-23 22:21:45 -07:00

40 lines
931 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NzbDrone.Core.Controllers;
using NzbDrone.Web.Models;
namespace NzbDrone.Web.Controllers
{
public class SettingsController : Controller
{
//
// GET: /Settings/
private IConfigController _configController;
public SettingsController(IConfigController configController)
{
_configController = configController;
}
public ActionResult Index()
{
return View(new SettingsModel() { RootPath = _configController.SeriesRoot });
}
[HttpPost]
public ActionResult Save(SettingsModel model)
{
if (ModelState.IsValid)
{
_configController.SeriesRoot = model.RootPath;
}
return RedirectToAction("index");
}
}
}