PostDownloadProvider broken down further.

Will try to reprocess _NzbDrone_ directories each pass, but will mark with an error when possible.
Attempt to process _UNPACK_ and _FAILED_ directories 30 minutes after first detected by NzbDrone (to give SAB time to unpack properly before processing).
This commit is contained in:
Mark McDowall 2011-10-14 08:37:19 -07:00
commit 8cac84b4ad
9 changed files with 362 additions and 43 deletions

View file

@ -405,12 +405,8 @@ namespace NzbDrone.Core.Providers
Logger.Trace("Finished deleting invalid episodes for {0}", series.SeriesId);
}
public virtual void SetPostDownloadStatus(string folderName, PostDownloadStatusType postDownloadStatus)
public virtual void SetPostDownloadStatus(IEnumerable<int> episodeIds, PostDownloadStatusType postDownloadStatus)
{
var parseResult = Parser.ParseTitle(folderName);
parseResult.Series = _seriesProvider.FindSeries(parseResult.CleanTitle);
var episodeIds = GetEpisodesByParseResult(parseResult).Select(e => e.EpisodeId);
var episodeIdString = String.Join(", ", episodeIds);
var episodeIdQuery = String.Format(@"UPDATE Episodes SET PostDownloadStatus = {0}