Fixed series grid after save so it has proper counts.

pull/7/merge
Mark McDowall 14 years ago
parent 56fdf1a040
commit 3a065b86f1

@ -42,11 +42,11 @@ namespace NzbDrone.Core.Providers
return series;
}
public virtual IList<Series> GetAllSeriesWithEpisodeCount(bool ignoreSpecials)
public virtual IList<Series> GetAllSeriesWithEpisodeCount(bool ignoreSpecialsInSeasonCount)
{
var seasonNumber = 0;
if (!ignoreSpecials)
if (!ignoreSpecialsInSeasonCount)
seasonNumber = -1;
var series = _database.Fetch<Series, QualityProfile>(@"SELECT Series.*, COUNT (NULLIF(Ignored, 1)) AS EpisodeCount,

@ -80,7 +80,7 @@ namespace NzbDrone.Web.Controllers
[GridAction]
public ActionResult _AjaxSeriesGrid()
{
var series = GetSeriesModels(_seriesProvider.GetAllSeriesWithEpisodeCount(true).ToList());
var series = GetSeriesModels(_seriesProvider.GetAllSeriesWithEpisodeCount(true));
return View(new GridModel(series));
}
@ -96,7 +96,7 @@ namespace NzbDrone.Web.Controllers
_seriesProvider.UpdateSeries(oldSeries);
var series = GetSeriesModels(_seriesProvider.GetAllSeries().ToList());
var series = GetSeriesModels(_seriesProvider.GetAllSeriesWithEpisodeCount(true));
return View(new GridModel(series));
}
@ -192,7 +192,7 @@ namespace NzbDrone.Web.Controllers
return RedirectToAction("Details", new { seriesId });
}
private List<SeriesModel> GetSeriesModels(List<Series> seriesInDb)
private List<SeriesModel> GetSeriesModels(IList<Series> seriesInDb)
{
var series = seriesInDb.Select(s => new SeriesModel
{

Loading…
Cancel
Save