Added two new Episode Statuses - Unpacking and Failed.

Tests added to support new Statuses.
PostDownloadScanJob will update PostDownloadStatus for failed or unpacking.
ImportFile will set the PostDownloadStatus to Processed when added to the database.
This commit is contained in:
Mark McDowall 2011-10-11 20:44:19 -07:00
commit 5098ea3249
15 changed files with 234 additions and 10 deletions

View file

@ -23,6 +23,8 @@ namespace NzbDrone.Core.Repository
public Boolean Ignored { get; set; }
public PostDownloadStatusType PostDownloadStatus { get; set; }
/// <summary>
/// Gets or sets the grab date.
/// </summary>
@ -39,15 +41,23 @@ namespace NzbDrone.Core.Repository
{
if (EpisodeFileId != 0) return EpisodeStatusType.Ready;
if (GrabDate != null && GrabDate.Value.AddDays(1) >= DateTime.Now)
if (GrabDate != null)
{
return EpisodeStatusType.Downloading;
if (PostDownloadStatus == PostDownloadStatusType.Unpacking)
return EpisodeStatusType.Unpacking;
if (PostDownloadStatus == PostDownloadStatusType.Failed)
return EpisodeStatusType.Failed;
if (GrabDate.Value.AddDays(1) >= DateTime.Now)
return EpisodeStatusType.Downloading;
}
if (GrabDate != null && GrabDate.Value.AddDays(1) >= DateTime.Now)
return EpisodeStatusType.Downloading;
if (AirDate != null && AirDate.Value.Date < DateTime.Now)
{
return EpisodeStatusType.Missing;
}
return EpisodeStatusType.NotAired;
}