mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-07 05:22:14 -07:00
added settings view to mvc project
This commit is contained in:
parent
941d516e42
commit
d7bae9135c
15 changed files with 89 additions and 148 deletions
|
@ -3,6 +3,8 @@ 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
|
||||
{
|
||||
|
@ -10,10 +12,27 @@ namespace NzbDrone.Web.Controllers
|
|||
{
|
||||
//
|
||||
// GET: /Settings/
|
||||
private IConfigController _configController;
|
||||
|
||||
public SettingsController(IConfigController configController)
|
||||
{
|
||||
_configController = configController;
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
return View(new SettingsModel() { RootPath = _configController.SeriesRoot });
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Save(SettingsModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_configController.SeriesRoot = model.RootPath;
|
||||
}
|
||||
|
||||
return RedirectToAction("index");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue