示例#1
0
        public BookModule(IAuthorService authorService,
                          IBookService bookService,
                          IAddBookService addBookService,
                          IEditionService editionService,
                          ISeriesBookLinkService seriesBookLinkService,
                          IAuthorStatisticsService authorStatisticsService,
                          IMapCoversToLocal coverMapper,
                          IUpgradableSpecification upgradableSpecification,
                          IBroadcastSignalRMessage signalRBroadcaster,
                          QualityProfileExistsValidator qualityProfileExistsValidator,
                          MetadataProfileExistsValidator metadataProfileExistsValidator)

            : base(bookService, seriesBookLinkService, authorStatisticsService, coverMapper, upgradableSpecification, signalRBroadcaster)
        {
            _authorService  = authorService;
            _editionService = editionService;
            _addBookService = addBookService;

            GetResourceAll = GetBooks;
            CreateResource = AddBook;
            UpdateResource = UpdateBook;
            DeleteResource = DeleteBook;
            Put("/monitor", x => SetBooksMonitored());

            PostValidator.RuleFor(s => s.ForeignBookId).NotEmpty();
            PostValidator.RuleFor(s => s.Author.QualityProfileId).SetValidator(qualityProfileExistsValidator);
            PostValidator.RuleFor(s => s.Author.MetadataProfileId).SetValidator(metadataProfileExistsValidator);
            PostValidator.RuleFor(s => s.Author.RootFolderPath).IsValidPath().When(s => s.Author.Path.IsNullOrWhiteSpace());
            PostValidator.RuleFor(s => s.Author.ForeignAuthorId).NotEmpty();
        }
示例#2
0
 public MissingController(IBookService bookService,
                          ISeriesBookLinkService seriesBookLinkService,
                          IAuthorStatisticsService authorStatisticsService,
                          IMapCoversToLocal coverMapper,
                          IUpgradableSpecification upgradableSpecification,
                          IBroadcastSignalRMessage signalRBroadcaster)
     : base(bookService, seriesBookLinkService, authorStatisticsService, coverMapper, upgradableSpecification, signalRBroadcaster)
 {
 }
示例#3
0
 public CalendarModule(IBookService bookService,
                       ISeriesBookLinkService seriesBookLinkService,
                       IAuthorStatisticsService authorStatisticsService,
                       IMapCoversToLocal coverMapper,
                       IUpgradableSpecification upgradableSpecification,
                       IBroadcastSignalRMessage signalRBroadcaster)
     : base(bookService, seriesBookLinkService, authorStatisticsService, coverMapper, upgradableSpecification, signalRBroadcaster, "calendar")
 {
     GetResourceAll = GetCalendar;
 }
示例#4
0
 public MissingModule(IBookService bookService,
                      ISeriesBookLinkService seriesBookLinkService,
                      IAuthorStatisticsService authorStatisticsService,
                      IMapCoversToLocal coverMapper,
                      IUpgradableSpecification upgradableSpecification,
                      IBroadcastSignalRMessage signalRBroadcaster)
     : base(bookService, seriesBookLinkService, authorStatisticsService, coverMapper, upgradableSpecification, signalRBroadcaster, "wanted/missing")
 {
     GetResourcePaged = GetMissingBooks;
 }
示例#5
0
 public CutoffModule(IBookCutoffService bookCutoffService,
                     IBookService bookService,
                     ISeriesBookLinkService seriesBookLinkService,
                     IAuthorStatisticsService authorStatisticsService,
                     IMapCoversToLocal coverMapper,
                     IUpgradableSpecification upgradableSpecification,
                     IBroadcastSignalRMessage signalRBroadcaster)
     : base(bookService, seriesBookLinkService, authorStatisticsService, coverMapper, upgradableSpecification, signalRBroadcaster, "wanted/cutoff")
 {
     _bookCutoffService = bookCutoffService;
     GetResourcePaged   = GetCutoffUnmetBooks;
 }
示例#6
0
 protected BookControllerWithSignalR(IBookService bookService,
                                     ISeriesBookLinkService seriesBookLinkService,
                                     IAuthorStatisticsService authorStatisticsService,
                                     IMapCoversToLocal coverMapper,
                                     IUpgradableSpecification qualityUpgradableSpecification,
                                     IBroadcastSignalRMessage signalRBroadcaster)
     : base(signalRBroadcaster)
 {
     _bookService                    = bookService;
     _seriesBookLinkService          = seriesBookLinkService;
     _authorStatisticsService        = authorStatisticsService;
     _coverMapper                    = coverMapper;
     _qualityUpgradableSpecification = qualityUpgradableSpecification;
 }
示例#7
0
 public RefreshSeriesService(IBookService bookService,
                             ISeriesService seriesService,
                             ISeriesBookLinkService linkService,
                             IRefreshSeriesBookLinkService refreshLinkService,
                             IAuthorMetadataService authorMetadataService,
                             Logger logger)
     : base(logger, authorMetadataService)
 {
     _bookService        = bookService;
     _seriesService      = seriesService;
     _linkService        = linkService;
     _refreshLinkService = refreshLinkService;
     _logger             = logger;
 }
示例#8
0
        protected BookModuleWithSignalR(IBookService bookService,
                                        ISeriesBookLinkService seriesBookLinkService,
                                        IAuthorStatisticsService authorStatisticsService,
                                        IMapCoversToLocal coverMapper,
                                        IUpgradableSpecification qualityUpgradableSpecification,
                                        IBroadcastSignalRMessage signalRBroadcaster,
                                        string resource)
            : base(signalRBroadcaster, resource)
        {
            _bookService                    = bookService;
            _seriesBookLinkService          = seriesBookLinkService;
            _authorStatisticsService        = authorStatisticsService;
            _coverMapper                    = coverMapper;
            _qualityUpgradableSpecification = qualityUpgradableSpecification;

            GetResourceById = GetBook;
        }
示例#9
0
        public BookController(IAuthorService authorService,
                              IBookService bookService,
                              IAddBookService addBookService,
                              IEditionService editionService,
                              ISeriesBookLinkService seriesBookLinkService,
                              IAuthorStatisticsService authorStatisticsService,
                              IMapCoversToLocal coverMapper,
                              IUpgradableSpecification upgradableSpecification,
                              IBroadcastSignalRMessage signalRBroadcaster,
                              QualityProfileExistsValidator qualityProfileExistsValidator,
                              MetadataProfileExistsValidator metadataProfileExistsValidator)

            : base(bookService, seriesBookLinkService, authorStatisticsService, coverMapper, upgradableSpecification, signalRBroadcaster)
        {
            _authorService  = authorService;
            _editionService = editionService;
            _addBookService = addBookService;

            PostValidator.RuleFor(s => s.ForeignBookId).NotEmpty();
            PostValidator.RuleFor(s => s.Author.QualityProfileId).SetValidator(qualityProfileExistsValidator);
            PostValidator.RuleFor(s => s.Author.MetadataProfileId).SetValidator(metadataProfileExistsValidator);
            PostValidator.RuleFor(s => s.Author.RootFolderPath).IsValidPath().When(s => s.Author.Path.IsNullOrWhiteSpace());
            PostValidator.RuleFor(s => s.Author.ForeignAuthorId).NotEmpty();
        }
 public RefreshSeriesBookLinkService(ISeriesBookLinkService trackService,
                                     Logger logger)
 {
     _seriesBookLinkService = trackService;
     _logger = logger;
 }