mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 11:48:26 -07:00
Added episode status to back end, getting ready for backlog
This commit is contained in:
parent
3bfa1c52b7
commit
f33c2c4939
7 changed files with 177 additions and 31 deletions
|
@ -23,12 +23,40 @@ namespace NzbDrone.Core.Repository
|
|||
[SubSonicLongString]
|
||||
public string Overview { get; set; }
|
||||
|
||||
public string Language { get; set; }
|
||||
public EpisodeStatusType Status { get; set; }
|
||||
public Boolean Ignored { get; set; }
|
||||
|
||||
public DateTime? LastInfoSync { get; set; }
|
||||
|
||||
public DateTime? LastDiskSync { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the grab date.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Used to specify when the episode was grapped.
|
||||
/// this filed is used by status as an expirable "Grabbed" status.
|
||||
/// </remarks>
|
||||
public DateTime? GrabDate { get; set; }
|
||||
|
||||
[SubSonicIgnore]
|
||||
public EpisodeStatusType Status
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Ignored || (Season != null && !Season.Monitored)) return EpisodeStatusType.Ignored;
|
||||
|
||||
if (GrabDate != null && GrabDate.Value.AddDays(1) >= DateTime.Now)
|
||||
{
|
||||
return EpisodeStatusType.Downloading;
|
||||
}
|
||||
|
||||
if (EpisodeFileId != 0) return EpisodeStatusType.Ready;
|
||||
|
||||
if (DateTime.Now.Date >= AirDate.Date)
|
||||
{
|
||||
return EpisodeStatusType.Missing;
|
||||
}
|
||||
|
||||
return EpisodeStatusType.NotAired;
|
||||
}
|
||||
}
|
||||
|
||||
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
|
||||
public virtual Season Season { get; set; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue