Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Sonarr/blame/commit/11e1deb5f7f0ece1cb7251c9cdc0e4cb109d43a4/NzbDrone.Web/Controllers/DirectoryController.cs You should set ROOT_URL correctly, otherwise the web may not work correctly.
Sonarr/NzbDrone.Web/Controllers/DirectoryController.cs

63 lines
1.6 KiB

using System;
using System.Collections.Generic;
using System.Web;
14 years ago
using System.Web.Helpers;
using System.Web.Mvc;
using NzbDrone.Core.Providers.Core;
namespace NzbDrone.Web.Controllers
{
public class DirectoryController : Controller
{
private readonly DiskProvider _diskProvider;
public DirectoryController(DiskProvider diskProvider)
{
_diskProvider = diskProvider;
}
[HttpPost]
public ActionResult _autoCompletePath(string text, int? filterMode)
{
var data = GetDirectories(text);
return new JsonResult
{
JsonRequestBehavior = JsonRequestBehavior.AllowGet,
Data = data
};
}
14 years ago
[HttpGet]
public JsonResult GetDirectories(string term)
{
14 years ago
string[] dirs = null;
try
{
//Windows (Including UNC)
var windowsSep = term.LastIndexOf('\\');
if (windowsSep > -1)
{
dirs = _diskProvider.GetDirectories(term.Substring(0, windowsSep + 1));
14 years ago
}
//Unix
var index = term.LastIndexOf('/');
if (index > -1)
{
dirs = _diskProvider.GetDirectories(term.Substring(0, index + 1));
}
}
catch
{
//Swallow the exceptions so proper JSON is returned to the client (Empty results)
}
14 years ago
return Json(dirs, JsonRequestBehavior.AllowGet);
}
}
}