mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 16:13:58 -07:00
TopSlider added for local series searching!
Should be easy to add others (would want to have it close other open ones, I think).
This commit is contained in:
parent
08804208cf
commit
745d9d9355
13 changed files with 241 additions and 78 deletions
|
@ -98,25 +98,17 @@ namespace NzbDrone.Web.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
public ActionResult SearchForSeries(string seriesName)
|
||||
public JsonResult LocalSearch(string term)
|
||||
{
|
||||
var model = new List<SeriesSearchResultModel>();
|
||||
//Get Results from the local DB and return
|
||||
|
||||
//Get Results from TvDb and convert them to something we can use.
|
||||
foreach (var tvdbSearchResult in _tvDbProvider.SearchSeries(seriesName))
|
||||
{
|
||||
model.Add(new SeriesSearchResultModel
|
||||
{
|
||||
TvDbId = tvdbSearchResult.Id,
|
||||
TvDbName = tvdbSearchResult.SeriesName,
|
||||
FirstAired = tvdbSearchResult.FirstAired
|
||||
});
|
||||
}
|
||||
var results = _seriesProvider.SearchForSeries(term).Select(s => new SeriesSearchResultModel
|
||||
{
|
||||
Id = s.SeriesId,
|
||||
Title = s.Title
|
||||
}).ToList();
|
||||
|
||||
//model.Add(new SeriesSearchResultModel{ TvDbId = 12345, TvDbName = "30 Rock", FirstAired = DateTime.Today });
|
||||
//model.Add(new SeriesSearchResultModel { TvDbId = 65432, TvDbName = "The Office (US)", FirstAired = DateTime.Today.AddDays(-100) });
|
||||
|
||||
return PartialView("SeriesSearchResults", model);
|
||||
return Json(results, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue