Added episode status to episode grid

pull/2/head
kay.one 14 years ago
parent a4f8947d90
commit 7b56711a4f

@ -115,5 +115,22 @@ namespace NzbDrone.Core.Test
Assert.AreEqual(status, episode.Status);
}
[Test]
public void low_air_date()
{
Episode episode = Builder<Episode>.CreateNew()
.With(e => e.AirDate = DateTime.Now.AddYears(-200))
.With(e => e.Ignored = false)
.With(e => e.EpisodeFileId = 0)
.With(e=>e.GrabDate =null)
.With(e => e.Season = Builder<Season>.CreateNew()
.With(s => s.Monitored = true).Build())
.Build();
Assert.AreEqual(EpisodeStatusType.NotAired, episode.Status);
}
}
}

@ -49,7 +49,7 @@ namespace NzbDrone.Core.Repository
if (EpisodeFileId != 0) return EpisodeStatusType.Ready;
if (DateTime.Now.Date >= AirDate.Date)
if (AirDate.Date.Year > 1900 && DateTime.Now.Date >= AirDate.Date)
{
return EpisodeStatusType.Missing;
}

@ -15,10 +15,8 @@ namespace NzbDrone.Web.Controllers
public class SeriesController : Controller
{
private readonly EpisodeProvider _episodeProvider;
private readonly MediaFileProvider _mediaFileProvider;
private readonly QualityProvider _qualityProvider;
private readonly RenameProvider _renameProvider;
private readonly RootDirProvider _rootDirProvider;
private readonly SeriesProvider _seriesProvider;
private readonly TvDbProvider _tvDbProvider;
private readonly JobProvider _jobProvider;
@ -28,17 +26,16 @@ namespace NzbDrone.Web.Controllers
public SeriesController(SeriesProvider seriesProvider,
EpisodeProvider episodeProvider,
QualityProvider qualityProvider, MediaFileProvider mediaFileProvider,
RenameProvider renameProvider, RootDirProvider rootDirProvider,
TvDbProvider tvDbProvider, JobProvider jobProvider,
QualityProvider qualityProvider,
RenameProvider renameProvider,
TvDbProvider tvDbProvider,
JobProvider jobProvider,
SeasonProvider seasonProvider)
{
_seriesProvider = seriesProvider;
_episodeProvider = episodeProvider;
_qualityProvider = qualityProvider;
_mediaFileProvider = mediaFileProvider;
_renameProvider = renameProvider;
_rootDirProvider = rootDirProvider;
_tvDbProvider = tvDbProvider;
_jobProvider = jobProvider;
_seasonProvider = seasonProvider;
@ -137,6 +134,7 @@ namespace NzbDrone.Web.Controllers
Overview = c.Overview,
AirDate = c.AirDate,
Path = GetEpisodePath(c.EpisodeFile),
Status = c.Status.ToString(),
Quality = c.EpisodeFile == null
? String.Empty
: c.EpisodeFile.Quality.ToString()

@ -1,4 +1,5 @@
using System;
using NzbDrone.Core.Model;
namespace NzbDrone.Web.Models
{
@ -10,6 +11,7 @@ namespace NzbDrone.Web.Models
public int SeasonNumber { get; set; }
public string Overview { get; set; }
public string Path { get; set; }
public String Status { get; set; }
public DateTime AirDate { get; set; }
public String Quality { get; set; }

@ -77,6 +77,7 @@
columns.Bound(c => c.AirDate).Format("{0:d}").Width(10);
columns.Bound(c => c.Quality).Width(10);
columns.Bound(c => c.Path);
columns.Bound(c => c.Status);
})
.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #> </br><#= Path #> </div>"))
.ClientEvents(clientEvents =>

Loading…
Cancel
Save