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-24 08:21:45 +03:00
|
|
|
using NzbDrone.Core.Controllers;
|
|
|
|
using NzbDrone.Web.Models;
|
2010-09-23 06:19:47 +03:00
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
{
|
|
|
|
public class SettingsController : Controller
|
|
|
|
{
|
|
|
|
//
|
|
|
|
// GET: /Settings/
|
2010-09-24 08:21:45 +03:00
|
|
|
private IConfigController _configController;
|
|
|
|
|
|
|
|
public SettingsController(IConfigController configController)
|
|
|
|
{
|
|
|
|
_configController = configController;
|
|
|
|
}
|
2010-09-23 06:19:47 +03:00
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
{
|
2010-09-24 08:21:45 +03:00
|
|
|
return View(new SettingsModel() { RootPath = _configController.SeriesRoot });
|
|
|
|
}
|
|
|
|
|
|
|
|
[HttpPost]
|
2010-09-24 08:37:48 +03:00
|
|
|
public ActionResult Index(SettingsModel model)
|
2010-09-24 08:21:45 +03:00
|
|
|
{
|
|
|
|
if (ModelState.IsValid)
|
|
|
|
{
|
|
|
|
_configController.SeriesRoot = model.RootPath;
|
|
|
|
}
|
|
|
|
|
|
|
|
return RedirectToAction("index");
|
2010-09-23 06:19:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|