mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-11 23:57:11 -07:00
root dir is done
This commit is contained in:
parent
859b68ed9e
commit
94e16a6037
8 changed files with 25 additions and 134 deletions
|
@ -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