mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
AutoComplete is now using jQuery UI AutoComplete.
Removed jquery.liveQuery.
This commit is contained in:
parent
59d4ae6219
commit
d330c65165
14 changed files with 107 additions and 380 deletions
|
@ -4,7 +4,6 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Helpers;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Core.Providers.Jobs;
|
||||
|
@ -170,12 +169,16 @@ namespace NzbDrone.Web.Controllers
|
|||
}
|
||||
|
||||
[HttpGet]
|
||||
public JsonResult LookupSeries(string q)
|
||||
public JsonResult LookupSeries(string term)
|
||||
{
|
||||
var tvDbResults = _tvDbProvider.SearchSeries(term).Select(r => new TvDbSearchResultModel
|
||||
{
|
||||
Id = r.Id,
|
||||
Title = r.SeriesName,
|
||||
FirstAired = r.FirstAired.ToShortDateString()
|
||||
}).ToList();
|
||||
|
||||
var dataVal = _tvDbProvider.SearchSeries(q);
|
||||
|
||||
return Json(dataVal.Select(c => new KeyValuePair<int, string>(c.Id, c.SeriesName)), JsonRequestBehavior.AllowGet);
|
||||
return Json(tvDbResults, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
public ActionResult RootList()
|
||||
|
|
|
@ -29,26 +29,26 @@ namespace NzbDrone.Web.Controllers
|
|||
}
|
||||
|
||||
[HttpGet]
|
||||
public JsonResult GetDirectories(string q)
|
||||
public JsonResult GetDirectories(string term)
|
||||
{
|
||||
string[] dirs = null;
|
||||
try
|
||||
{
|
||||
//Windows (Including UNC)
|
||||
var windowsSep = q.LastIndexOf('\\');
|
||||
var windowsSep = term.LastIndexOf('\\');
|
||||
|
||||
if (windowsSep > -1)
|
||||
{
|
||||
dirs = _diskProvider.GetDirectories(q.Substring(0, windowsSep + 1));
|
||||
dirs = _diskProvider.GetDirectories(term.Substring(0, windowsSep + 1));
|
||||
|
||||
}
|
||||
|
||||
//Unix
|
||||
var index = q.LastIndexOf('/');
|
||||
var index = term.LastIndexOf('/');
|
||||
|
||||
if (index > -1)
|
||||
{
|
||||
dirs = _diskProvider.GetDirectories(q.Substring(0, index + 1));
|
||||
dirs = _diskProvider.GetDirectories(term.Substring(0, index + 1));
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
|
|
@ -45,9 +45,13 @@ namespace NzbDrone.Web.Controllers
|
|||
return View();
|
||||
}
|
||||
|
||||
public ActionResult TestPartial()
|
||||
public JsonResult TestResults(string q)
|
||||
{
|
||||
return View();
|
||||
var results = new List<TvDbSearchResultModel>();
|
||||
results.Add(new TvDbSearchResultModel { Id = 1, Title = "30 Rock", FirstAired = DateTime.Today.ToShortDateString() });
|
||||
results.Add(new TvDbSearchResultModel { Id = 2, Title = "The Office", FirstAired = DateTime.Today.AddDays(-1).ToShortDateString() });
|
||||
|
||||
return Json(results, JsonRequestBehavior.AllowGet );
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue