mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 08:07:10 -07:00
App_Data added to .gitignore
Added SetValue to ConfigFileProvider. Added creating of default config file in ConfigFileProvider. Added more ConfigFileProvider tests. Added UI for Settings/System
This commit is contained in:
parent
f0f706b32c
commit
ec6a0e6b7f
9 changed files with 185 additions and 3 deletions
|
@ -29,15 +29,18 @@ namespace NzbDrone.Web.Controllers
|
|||
private readonly ExternalNotificationProvider _externalNotificationProvider;
|
||||
private readonly QualityTypeProvider _qualityTypeProvider;
|
||||
private readonly RootDirProvider _rootDirProvider;
|
||||
private readonly ConfigFileProvider _configFileProvider;
|
||||
|
||||
public SettingsController(ConfigProvider configProvider, IndexerProvider indexerProvider,
|
||||
QualityProvider qualityProvider, AutoConfigureProvider autoConfigureProvider,
|
||||
SeriesProvider seriesProvider, ExternalNotificationProvider externalNotificationProvider,
|
||||
QualityTypeProvider qualityTypeProvider, RootDirProvider rootDirProvider)
|
||||
QualityTypeProvider qualityTypeProvider, RootDirProvider rootDirProvider,
|
||||
ConfigFileProvider configFileProvider)
|
||||
{
|
||||
_externalNotificationProvider = externalNotificationProvider;
|
||||
_qualityTypeProvider = qualityTypeProvider;
|
||||
_rootDirProvider = rootDirProvider;
|
||||
_configFileProvider = configFileProvider;
|
||||
_configProvider = configProvider;
|
||||
_indexerProvider = indexerProvider;
|
||||
_qualityProvider = qualityProvider;
|
||||
|
@ -184,6 +187,15 @@ namespace NzbDrone.Web.Controllers
|
|||
return View(model);
|
||||
}
|
||||
|
||||
public ActionResult System()
|
||||
{
|
||||
var model = new SystemSettingsModel();
|
||||
model.Port = _configFileProvider.Port;
|
||||
model.LaunchBrowser = _configFileProvider.LaunchBrowser;
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public ViewResult AddProfile()
|
||||
{
|
||||
var qualityTypes = new List<QualityTypes>();
|
||||
|
@ -436,6 +448,20 @@ namespace NzbDrone.Web.Controllers
|
|||
return GetInvalidModelResult();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public JsonResult SaveSystem(SystemSettingsModel data)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_configFileProvider.Port = data.Port;
|
||||
_configFileProvider.LaunchBrowser = data.LaunchBrowser;
|
||||
|
||||
return GetSuccessResult();
|
||||
}
|
||||
|
||||
return GetInvalidModelResult();
|
||||
}
|
||||
|
||||
private JsonResult GetSuccessResult()
|
||||
{
|
||||
return Json(new NotificationResult() { Title = "Settings Saved" });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue