mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
root dir is done
This commit is contained in:
parent
859b68ed9e
commit
94e16a6037
8 changed files with 25 additions and 134 deletions
|
@ -55,7 +55,7 @@ namespace NzbDrone.Web.Controllers
|
|||
Path = r.Path,
|
||||
CleanPath = r.Path.Replace(Path.DirectorySeparatorChar, '|').Replace(Path.VolumeSeparatorChar, '^').Replace('\'', '`')
|
||||
});
|
||||
ViewData["RootDirs"] = rootDirs;
|
||||
ViewData["RootDirs"] = rootDirs.ToList();
|
||||
ViewData["DirSep"] = Path.DirectorySeparatorChar.ToString().Replace(Path.DirectorySeparatorChar, '|');
|
||||
|
||||
var defaultQuality = _configProvider.DefaultQualityProfile;
|
||||
|
@ -88,11 +88,6 @@ namespace NzbDrone.Web.Controllers
|
|||
}
|
||||
|
||||
|
||||
public ActionResult Test()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult AddExisting()
|
||||
{
|
||||
var rootDirs = _rootFolderProvider.GetAll();
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace NzbDrone.Web.Controllers
|
|||
[HttpGet]
|
||||
public JsonResult GetDirectories(string q)
|
||||
{
|
||||
string[] dirs = null;
|
||||
try
|
||||
{
|
||||
//Windows (Including UNC)
|
||||
|
@ -39,18 +40,16 @@ namespace NzbDrone.Web.Controllers
|
|||
|
||||
if (windowsSep > -1)
|
||||
{
|
||||
var dirs = _diskProvider.GetDirectories(q.Substring(0, windowsSep + 1));
|
||||
return Json(dirs, JsonRequestBehavior.AllowGet);
|
||||
dirs = _diskProvider.GetDirectories(q.Substring(0, windowsSep + 1));
|
||||
|
||||
}
|
||||
|
||||
return Json(new string[] { }, JsonRequestBehavior.AllowGet);
|
||||
//Unix
|
||||
var index = q.LastIndexOf('/');
|
||||
|
||||
if (index > -1)
|
||||
{
|
||||
var dirs = _diskProvider.GetDirectories(q.Substring(0, index + 1));
|
||||
//return new SelectList(dirs, dirs.FirstOrDefault());
|
||||
dirs = _diskProvider.GetDirectories(q.Substring(0, index + 1));
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
@ -58,7 +57,7 @@ namespace NzbDrone.Web.Controllers
|
|||
//Swallow the exceptions so proper JSON is returned to the client (Empty results)
|
||||
}
|
||||
|
||||
return Json(new string[]{}, JsonRequestBehavior.AllowGet);
|
||||
return Json(dirs, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue