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:
Mark McDowall 2011-10-20 16:36:47 -07:00
parent 08804208cf
commit 745d9d9355
13 changed files with 241 additions and 78 deletions

View file

@ -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]