1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 18:12:37 +01:00

Added episode status to episode grid

This commit is contained in:
kay.one 2011-05-22 10:29:10 -07:00
parent a4f8947d90
commit 7b56711a4f
5 changed files with 26 additions and 8 deletions

View File

@ -115,5 +115,22 @@ public void skipped_season(int offsetDays, bool hasEpisodes, bool ignored, Episo
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);
}
}
}

View File

@ -49,7 +49,7 @@ public EpisodeStatusType Status
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;
}

View File

@ -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 @@ public class SeriesController : Controller
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 @@ public ActionResult _AjaxSeasonGrid(int seasonId)
Overview = c.Overview,
AirDate = c.AirDate,
Path = GetEpisodePath(c.EpisodeFile),
Status = c.Status.ToString(),
Quality = c.EpisodeFile == null
? String.Empty
: c.EpisodeFile.Quality.ToString()

View File

@ -1,4 +1,5 @@
using System;
using NzbDrone.Core.Model;
namespace NzbDrone.Web.Models
{
@ -10,6 +11,7 @@ public class EpisodeModel
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; }

View File

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