mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-11 15:47:09 -07:00
Moved root dir config to add series.
Cleaned up Indexers.cshtml. Indexers is the new default Settings page.
This commit is contained in:
parent
f6578bd535
commit
f27c1d89f6
12 changed files with 355 additions and 357 deletions
|
@ -62,21 +62,11 @@ namespace NzbDrone.Web.Controllers
|
|||
ViewData["viewName"] = viewName;
|
||||
|
||||
else
|
||||
return RedirectToAction("General");
|
||||
return RedirectToAction("Indexers");
|
||||
|
||||
return View("Index");
|
||||
}
|
||||
|
||||
public ActionResult General()
|
||||
{
|
||||
ViewData["viewName"] = "General";
|
||||
|
||||
return View("Index", new SettingsModel
|
||||
{
|
||||
Directories = _rootDirProvider.GetAll()
|
||||
});
|
||||
}
|
||||
|
||||
public ActionResult Indexers()
|
||||
{
|
||||
ViewData["viewName"] = "Indexers";
|
||||
|
@ -236,40 +226,6 @@ namespace NzbDrone.Web.Controllers
|
|||
return PartialView("QualityProfileItem", profile);
|
||||
}
|
||||
|
||||
public ViewResult AddRootDir()
|
||||
{
|
||||
var rootDir = new RootDir { Path = String.Empty };
|
||||
|
||||
var id = _rootDirProvider.Add(rootDir);
|
||||
rootDir.Id = id;
|
||||
|
||||
ViewData["RootDirId"] = id;
|
||||
|
||||
return View("RootDir", rootDir);
|
||||
}
|
||||
|
||||
public ActionResult GetRootDirView(RootDir rootDir)
|
||||
{
|
||||
ViewData["RootDirId"] = rootDir.Id;
|
||||
|
||||
return PartialView("RootDir", rootDir);
|
||||
}
|
||||
|
||||
public JsonResult DeleteRootDir(int rootDirId)
|
||||
{
|
||||
try
|
||||
{
|
||||
_rootDirProvider.Remove(rootDirId);
|
||||
}
|
||||
|
||||
catch (Exception)
|
||||
{
|
||||
return new JsonResult { Data = "failed" };
|
||||
}
|
||||
|
||||
return new JsonResult { Data = "ok" };
|
||||
}
|
||||
|
||||
public ActionResult SubMenu()
|
||||
{
|
||||
return PartialView();
|
||||
|
@ -317,29 +273,6 @@ namespace NzbDrone.Web.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
public JsonResult JsonAutoCompletePath(string term)
|
||||
{
|
||||
var windowsSep = term.LastIndexOf('\\');
|
||||
|
||||
if (windowsSep > -1)
|
||||
{
|
||||
var start = term.Substring(windowsSep + 1);
|
||||
var dirs = _diskProvider.GetDirectories(term.Substring(0, windowsSep + 1)).Where(d => new DirectoryInfo(d).Name.ToLower().StartsWith(start.ToLower())).Take(10);
|
||||
return Json(dirs.ToArray(), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
var index = term.LastIndexOf('/');
|
||||
|
||||
if (index > -1)
|
||||
{
|
||||
var start = term.Substring(index + 1);
|
||||
var dirs = _diskProvider.GetDirectories(term.Substring(0, index + 1)).Where(d => new DirectoryInfo(d).Name.ToLower().StartsWith(start.ToLower())).Take(10);
|
||||
return Json(dirs.ToArray(), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
return Json(new JsonResult(), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult SaveGeneral(SettingsModel data)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue