mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Added episode status to back end, getting ready for backlog
This commit is contained in:
@@ -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; }
|
||||
|
Reference in New Issue
Block a user