Пример #1
0
        public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
                             ISearchForReleases releaseSearchService,
                             IMakeDownloadDecision downloadDecisionMaker,
                             IPrioritizeDownloadDecision prioritizeDownloadDecision,
                             IDownloadService downloadService,
                             ISeriesService seriesService,
                             IEpisodeService episodeService,
                             IParsingService parsingService,
                             ICacheManager cacheManager,
                             ILanguageProfileService languageProfileService,
                             IQualityProfileService qualityProfileService,
                             Logger logger) :
            base(languageProfileService, qualityProfileService)
        {
            _rssFetcherAndParser        = rssFetcherAndParser;
            _releaseSearchService       = releaseSearchService;
            _downloadDecisionMaker      = downloadDecisionMaker;
            _prioritizeDownloadDecision = prioritizeDownloadDecision;
            _downloadService            = downloadService;
            _seriesService  = seriesService;
            _episodeService = episodeService;
            _parsingService = parsingService;
            _logger         = logger;

            PostValidator.RuleFor(s => s.IndexerId).ValidId();
            PostValidator.RuleFor(s => s.Guid).NotEmpty();

            GetResourceAll = GetReleases;
            Post("/", x => DownloadRelease(ReadResourceFromRequest()));

            _remoteEpisodeCache = cacheManager.GetCache <RemoteEpisode>(GetType(), "remoteEpisodes");
        }
Пример #2
0
 public PersistenceProcessor(
     ICustomFormatService customFormatService,
     IQualityProfileService qualityProfileService,
     IConfigurationProvider configProvider,
     Func <IPersistenceProcessorSteps> stepsFactory)
 {
     _customFormatService   = customFormatService;
     _qualityProfileService = qualityProfileService;
     _stepsFactory          = stepsFactory;
     _configProvider        = configProvider;
     _steps = _stepsFactory();
 }
Пример #3
0
        public ProfileModule(IQualityProfileService qualityProfileService)
        {
            _qualityProfileService = qualityProfileService;
            SharedValidator.RuleFor(c => c.Name).NotEmpty();
            SharedValidator.RuleFor(c => c.Cutoff).ValidCutoff();
            SharedValidator.RuleFor(c => c.Items).ValidItems();

            GetResourceAll  = GetAll;
            GetResourceById = GetById;
            UpdateResource  = Update;
            CreateResource  = Create;
            DeleteResource  = DeleteProfile;
        }
Пример #4
0
        public QualityProfileModule(IQualityProfileService qualityProfileService)
        {
            _qualityProfileService = qualityProfileService;
            SharedValidator.RuleFor(c => c.Name).NotEmpty();
            SharedValidator.RuleFor(c => c.Cutoff).NotNull();
            SharedValidator.RuleFor(c => c.Items).MustHaveAllowedQuality();//.SetValidator(new AllowedValidator<QualityProfileItemResource>());

            GetResourceAll  = GetAll;
            GetResourceById = GetById;
            UpdateResource  = Update;
            CreateResource  = Create;
            DeleteResource  = DeleteProfile;
        }
Пример #5
0
        public QueueModule(IBroadcastSignalRMessage broadcastSignalRMessage,
                           IQueueService queueService,
                           IPendingReleaseService pendingReleaseService,
                           ILanguageProfileService languageProfileService,
                           IQualityProfileService qualityProfileService)
            : base(broadcastSignalRMessage)
        {
            _queueService          = queueService;
            _pendingReleaseService = pendingReleaseService;
            GetResourcePaged       = GetQueue;

            LANGUAGE_COMPARER = new LanguageComparer(languageProfileService.GetDefaultProfile(string.Empty));
            QUALITY_COMPARER  = new QualityModelComparer(qualityProfileService.GetDefaultProfile(string.Empty));
        }
Пример #6
0
        public QualityProfileModule(IQualityProfileService qualityProfileService)
            : base("/qualityprofiles")
        {
            _qualityProfileService = qualityProfileService;

            SharedValidator.RuleFor(c => c.Name).NotEmpty();
            SharedValidator.RuleFor(c => c.Cutoff).NotNull();
            SharedValidator.RuleFor(c => c.Allowed).NotEmpty();

            GetResourceAll = GetAll;

            GetResourceById = GetById;

            UpdateResource = Update;

            CreateResource = Create;

            DeleteResource = DeleteProfile;
        }
Пример #7
0
        public ReleasePushModule(IMakeDownloadDecision downloadDecisionMaker,
                                 IProcessDownloadDecisions downloadDecisionProcessor,
                                 IIndexerFactory indexerFactory,
                                 ILanguageProfileService languageProfileService,
                                 IQualityProfileService qualityProfileService,
                                 Logger logger) :
            base(languageProfileService, qualityProfileService)
        {
            _downloadDecisionMaker     = downloadDecisionMaker;
            _downloadDecisionProcessor = downloadDecisionProcessor;
            _indexerFactory            = indexerFactory;
            _logger = logger;

            PostValidator.RuleFor(s => s.Title).NotEmpty();
            PostValidator.RuleFor(s => s.DownloadUrl).NotEmpty();
            PostValidator.RuleFor(s => s.Protocol).NotEmpty();
            PostValidator.RuleFor(s => s.PublishDate).NotEmpty();

            Post("/push", x => ProcessRelease(ReadResourceFromRequest()));
        }
Пример #8
0
 public EpisodeCutoffService(IEpisodeRepository episodeRepository, IQualityProfileService qualityProfileService, Logger logger)
 {
     _episodeRepository     = episodeRepository;
     _qualityProfileService = qualityProfileService;
     _logger = logger;
 }
Пример #9
0
 public EpisodeCutoffService(IEpisodeRepository episodeRepository, IQualityProfileService qualityProfileService, Logger logger)
 {
     _episodeRepository = episodeRepository;
     _qualityProfileService = qualityProfileService;
     _logger = logger;
 }
Пример #10
0
 public ReleaseModuleBase(ILanguageProfileService languageProfileService,
                          IQualityProfileService qualityProfileService)
 {
     LANGUAGE_PROFILE = languageProfileService.GetDefaultProfile(string.Empty);
     QUALITY_PROFILE  = qualityProfileService.GetDefaultProfile(string.Empty);
 }
Пример #11
0
 public ProfileExistsValidator(IQualityProfileService qualityProfileService)
     : base("QualityProfile does not exist")
 {
     _qualityProfileService = qualityProfileService;
 }
Пример #12
0
 public EpisodeCutoffService(IEpisodeRepository episodeRepository, IQualityProfileService qualityProfileService, ILanguageProfileService languageProfileService, Logger logger)
 {
     _episodeRepository      = episodeRepository;
     _qualityProfileService  = qualityProfileService;
     _languageProfileService = languageProfileService;
 }
 public QualityProfileSchemaModule(IQualityProfileService qualityProfileService)
     : base("/qualityprofile/schema")
 {
     _qualityProfileService = qualityProfileService;
     GetResourceSingle      = GetSchema;
 }