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-28 04:25:41 +00:00
|
|
|
|
using NzbDrone.Core.Providers;
|
2010-09-24 05:21:45 +00:00
|
|
|
|
using NzbDrone.Web.Models;
|
2010-09-23 03:19:47 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class SettingsController : Controller
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
// GET: /Settings/
|
2010-09-28 04:25:41 +00:00
|
|
|
|
private IConfigProvider _configProvider;
|
2010-09-24 05:21:45 +00:00
|
|
|
|
|
2010-09-28 04:25:41 +00:00
|
|
|
|
public SettingsController(IConfigProvider configProvider)
|
2010-09-24 05:21:45 +00:00
|
|
|
|
{
|
2010-09-28 04:25:41 +00:00
|
|
|
|
_configProvider = configProvider;
|
2010-09-24 05:21:45 +00:00
|
|
|
|
}
|
2010-09-23 03:19:47 +00:00
|
|
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
|
{
|
2010-09-28 04:25:41 +00:00
|
|
|
|
return View(new SettingsModel() { TvFolder = _configProvider.SeriesRoot });
|
2010-09-24 05:21:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
2010-09-24 05:37:48 +00:00
|
|
|
|
public ActionResult Index(SettingsModel model)
|
2010-09-24 05:21:45 +00:00
|
|
|
|
{
|
|
|
|
|
if (ModelState.IsValid)
|
|
|
|
|
{
|
2010-09-28 04:25:41 +00:00
|
|
|
|
_configProvider.SeriesRoot = model.TvFolder;
|
2010-09-24 07:14:42 +00:00
|
|
|
|
//return RedirectToAction("index");
|
2010-09-24 05:21:45 +00:00
|
|
|
|
}
|
2010-09-24 07:14:42 +00:00
|
|
|
|
|
|
|
|
|
return View(model);
|
2010-09-23 03:19:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|