|
|
@ -21,6 +21,7 @@ namespace NzbDrone.Web.Controllers
|
|
|
|
private readonly TvDbProvider _tvDbProvider;
|
|
|
|
private readonly TvDbProvider _tvDbProvider;
|
|
|
|
private readonly JobProvider _jobProvider;
|
|
|
|
private readonly JobProvider _jobProvider;
|
|
|
|
private readonly SeasonProvider _seasonProvider;
|
|
|
|
private readonly SeasonProvider _seasonProvider;
|
|
|
|
|
|
|
|
private readonly MediaFileProvider _mediaFileProvider;
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// GET: /Series/
|
|
|
|
// GET: /Series/
|
|
|
|
|
|
|
|
|
|
|
@ -29,8 +30,9 @@ namespace NzbDrone.Web.Controllers
|
|
|
|
QualityProvider qualityProvider,
|
|
|
|
QualityProvider qualityProvider,
|
|
|
|
RenameProvider renameProvider,
|
|
|
|
RenameProvider renameProvider,
|
|
|
|
TvDbProvider tvDbProvider,
|
|
|
|
TvDbProvider tvDbProvider,
|
|
|
|
JobProvider jobProvider,
|
|
|
|
JobProvider jobProvider,
|
|
|
|
SeasonProvider seasonProvider)
|
|
|
|
SeasonProvider seasonProvider,
|
|
|
|
|
|
|
|
MediaFileProvider mediaFileProvider)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_seriesProvider = seriesProvider;
|
|
|
|
_seriesProvider = seriesProvider;
|
|
|
|
_episodeProvider = episodeProvider;
|
|
|
|
_episodeProvider = episodeProvider;
|
|
|
@ -39,6 +41,7 @@ namespace NzbDrone.Web.Controllers
|
|
|
|
_tvDbProvider = tvDbProvider;
|
|
|
|
_tvDbProvider = tvDbProvider;
|
|
|
|
_jobProvider = jobProvider;
|
|
|
|
_jobProvider = jobProvider;
|
|
|
|
_seasonProvider = seasonProvider;
|
|
|
|
_seasonProvider = seasonProvider;
|
|
|
|
|
|
|
|
_mediaFileProvider = mediaFileProvider;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
public ActionResult Index()
|
|
|
@ -135,16 +138,12 @@ namespace NzbDrone.Web.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
public JsonResult GetEpisodeCount(int seriesId)
|
|
|
|
public JsonResult GetEpisodeCount(int seriesId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var series = _seriesProvider.GetSeries(seriesId);
|
|
|
|
var count = _mediaFileProvider.GetEpisodeFilesCount(seriesId);
|
|
|
|
|
|
|
|
|
|
|
|
var monitoredSeasons = series.Seasons.Where(e => e.Monitored).Select(e => e.SeasonId);
|
|
|
|
|
|
|
|
var episodeTotal = series.Episodes.Where(e => monitoredSeasons.Contains(e.SeasonId) && e.AirDate <= DateTime.Today && e.AirDate > new DateTime(1899, 12, 31));
|
|
|
|
|
|
|
|
var episodes = episodeTotal.Where(e => e.EpisodeFileId > 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Json(new
|
|
|
|
return Json(new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Episodes = episodes.Count(),
|
|
|
|
Episodes = count.Item1,
|
|
|
|
EpisodeTotal = episodeTotal.Count()
|
|
|
|
EpisodeTotal = count.Item2
|
|
|
|
}, JsonRequestBehavior.AllowGet);
|
|
|
|
}, JsonRequestBehavior.AllowGet);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|