private List <ReleaseResource> GetRss() { var reports = _rssFetcherAndParser.Fetch(); var decisions = _downloadDecisionMaker.GetRssDecision(reports); return(MapDecisions(decisions)); }
private Response ProcessRelease(ReleaseResource release) { _logger.Info("Release pushed: {0} - {1}", release.Title, release.DownloadUrl); var info = release.ToModel(); info.Guid = "PUSH-" + info.DownloadUrl; ResolveIndexer(info); var decisions = _downloadDecisionMaker.GetRssDecision(new List <ReleaseInfo> { info }); _downloadDecisionProcessor.ProcessDecisions(decisions); var firstDecision = decisions.FirstOrDefault(); if (firstDecision?.RemoteAlbum.ParsedAlbumInfo == null) { throw new ValidationException(new List <ValidationFailure> { new ValidationFailure("Title", "Unable to parse", release.Title) }); } return(MapDecisions(new[] { firstDecision }).First().AsResponse()); }
private List <ReleaseResource> GetRss() { var reports = _rssFetcherAndParser.Fetch(); var decisions = _downloadDecisionMaker.GetRssDecision(reports); var prioritizedDecisions = _prioritizeDownloadDecision.PrioritizeDecisionsForMovies(decisions); return(MapDecisions(prioritizedDecisions)); }
public void Sync() { _logger.ProgressInfo("Starting RSS Sync"); var reports = _rssFetcherAndParser.Fetch(); var decisions = _downloadDecisionMaker.GetRssDecision(reports); var downloaded = _downloadApprovedReports.DownloadApproved(decisions); _logger.ProgressInfo("RSS Sync Completed. Reports found: {0}, Reports downloaded: {1}", reports.Count, downloaded.Count()); }
private Response ProcessRelease(ReleaseResource release) { _logger.Info("Release pushed: {0} - {1}", release.Title, release.DownloadUrl); var info = release.InjectTo <ReleaseInfo>(); info.Guid = "PUSH-" + info.DownloadUrl; var decisions = _downloadDecisionMaker.GetRssDecision(new List <ReleaseInfo> { info }); var processed = _downloadDecisionProcessor.ProcessDecisions(decisions); return(MapDecisions(decisions).First().AsResponse()); }
private object ProcessRelease(ReleaseResource release) { _logger.Info("Release pushed: {0} - {1}", release.Title, release.DownloadUrl); var info = release.ToModel(); info.Guid = "PUSH-" + info.DownloadUrl; ResolveIndexer(info); var decisions = _downloadDecisionMaker.GetRssDecision(new List <ReleaseInfo> { info }); _downloadDecisionProcessor.ProcessDecisions(decisions); return(MapDecisions(decisions).First()); }
private ProcessedDecisions Sync() { _logger.ProgressInfo("Starting RSS Sync"); var reports = _rssFetcherAndParser.Fetch().Concat(_pendingReleaseService.GetPending()).ToList(); var decisions = _downloadDecisionMaker.GetRssDecision(reports); var processed = _processDownloadDecisions.ProcessDecisions(decisions); var message = String.Format("RSS Sync Completed. Reports found: {0}, Reports grabbed: {1}", reports.Count, processed.Grabbed.Count); if (processed.Pending.Any()) { message += ", Reports pending: " + processed.Pending.Count; } _logger.ProgressInfo(message); return(processed); }