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