2010-09-23 03:19:47 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Mvc;
|
2010-09-24 05:21:45 +00:00
|
|
|
|
using NzbDrone.Core.Controllers;
|
|
|
|
|
using NzbDrone.Web.Models;
|
2010-09-23 03:19:47 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class SettingsController : Controller
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
// GET: /Settings/
|
2010-09-24 05:21:45 +00:00
|
|
|
|
private IConfigController _configController;
|
|
|
|
|
|
|
|
|
|
public SettingsController(IConfigController configController)
|
|
|
|
|
{
|
|
|
|
|
_configController = configController;
|
|
|
|
|
}
|
2010-09-23 03:19:47 +00:00
|
|
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
|
{
|
2010-09-24 05:21:45 +00:00
|
|
|
|
return View(new SettingsModel() { RootPath = _configController.SeriesRoot });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public ActionResult Save(SettingsModel model)
|
|
|
|
|
{
|
|
|
|
|
if (ModelState.IsValid)
|
|
|
|
|
{
|
|
|
|
|
_configController.SeriesRoot = model.RootPath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return RedirectToAction("index");
|
2010-09-23 03:19:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|