示例#1
0
 public RefreshBookService(IBookService bookService,
                           IAuthorService authorService,
                           IAddAuthorService addAuthorService,
                           IEditionService editionService,
                           IAuthorMetadataService authorMetadataService,
                           IProvideAuthorInfo authorInfo,
                           IProvideBookInfo bookInfo,
                           IRefreshEditionService refreshEditionService,
                           IMediaFileService mediaFileService,
                           IHistoryService historyService,
                           IEventAggregator eventAggregator,
                           ICheckIfBookShouldBeRefreshed checkIfBookShouldBeRefreshed,
                           IMapCoversToLocal mediaCoverService,
                           Logger logger)
     : base(logger, authorMetadataService)
 {
     _bookService                  = bookService;
     _authorService                = authorService;
     _addAuthorService             = addAuthorService;
     _editionService               = editionService;
     _authorInfo                   = authorInfo;
     _bookInfo                     = bookInfo;
     _refreshEditionService        = refreshEditionService;
     _mediaFileService             = mediaFileService;
     _historyService               = historyService;
     _eventAggregator              = eventAggregator;
     _checkIfBookShouldBeRefreshed = checkIfBookShouldBeRefreshed;
     _mediaCoverService            = mediaCoverService;
     _logger = logger;
 }
示例#2
0
 public ImportApprovedBooks(IUpgradeMediaFiles bookFileUpgrader,
                            IMediaFileService mediaFileService,
                            IAudioTagService audioTagService,
                            IAuthorService authorService,
                            IAddAuthorService addAuthorService,
                            IRefreshAuthorService refreshAuthorService,
                            IBookService bookService,
                            IEditionService editionService,
                            IRootFolderService rootFolderService,
                            IRecycleBinProvider recycleBinProvider,
                            IExtraService extraService,
                            IDiskProvider diskProvider,
                            IEventAggregator eventAggregator,
                            IManageCommandQueue commandQueueManager,
                            Logger logger)
 {
     _bookFileUpgrader     = bookFileUpgrader;
     _mediaFileService     = mediaFileService;
     _audioTagService      = audioTagService;
     _authorService        = authorService;
     _addAuthorService     = addAuthorService;
     _refreshAuthorService = refreshAuthorService;
     _bookService          = bookService;
     _editionService       = editionService;
     _rootFolderService    = rootFolderService;
     _recycleBinProvider   = recycleBinProvider;
     _extraService         = extraService;
     _diskProvider         = diskProvider;
     _eventAggregator      = eventAggregator;
     _commandQueueManager  = commandQueueManager;
     _logger = logger;
 }
示例#3
0
 public ImportListSyncService(IImportListFactory importListFactory,
                              IImportListExclusionService importListExclusionService,
                              IFetchAndParseImportList listFetcherAndParser,
                              ISearchForNewBook bookSearchService,
                              ISearchForNewAuthor authorSearchService,
                              IAuthorService authorService,
                              IBookService bookService,
                              IAddAuthorService addAuthorService,
                              IAddBookService addBookService,
                              IEventAggregator eventAggregator,
                              IManageCommandQueue commandQueueManager,
                              Logger logger)
 {
     _importListFactory          = importListFactory;
     _importListExclusionService = importListExclusionService;
     _listFetcherAndParser       = listFetcherAndParser;
     _bookSearchService          = bookSearchService;
     _authorSearchService        = authorSearchService;
     _authorService       = authorService;
     _bookService         = bookService;
     _addAuthorService    = addAuthorService;
     _addBookService      = addBookService;
     _eventAggregator     = eventAggregator;
     _commandQueueManager = commandQueueManager;
     _logger = logger;
 }
示例#4
0
 public ImportListSyncService(IImportListFactory importListFactory,
                              IImportListExclusionService importListExclusionService,
                              IFetchAndParseImportList listFetcherAndParser,
                              IGoodreadsProxy goodreadsProxy,
                              IGoodreadsSearchProxy goodreadsSearchProxy,
                              IAuthorService authorService,
                              IBookService bookService,
                              IEditionService editionService,
                              IAddAuthorService addAuthorService,
                              IAddBookService addBookService,
                              IEventAggregator eventAggregator,
                              IManageCommandQueue commandQueueManager,
                              Logger logger)
 {
     _importListFactory          = importListFactory;
     _importListExclusionService = importListExclusionService;
     _listFetcherAndParser       = listFetcherAndParser;
     _goodreadsProxy             = goodreadsProxy;
     _goodreadsSearchProxy       = goodreadsSearchProxy;
     _authorService       = authorService;
     _bookService         = bookService;
     _editionService      = editionService;
     _addAuthorService    = addAuthorService;
     _addBookService      = addBookService;
     _eventAggregator     = eventAggregator;
     _commandQueueManager = commandQueueManager;
     _logger = logger;
 }
示例#5
0
        public AuthorModule(IBroadcastSignalRMessage signalRBroadcaster,
                            IAuthorService authorService,
                            IBookService bookService,
                            IAddAuthorService addAuthorService,
                            IAuthorStatisticsService authorStatisticsService,
                            IMapCoversToLocal coverMapper,
                            IManageCommandQueue commandQueueManager,
                            IRootFolderService rootFolderService,
                            RootFolderValidator rootFolderValidator,
                            MappedNetworkDriveValidator mappedNetworkDriveValidator,
                            AuthorPathValidator authorPathValidator,
                            AuthorExistsValidator authorExistsValidator,
                            AuthorAncestorValidator authorAncestorValidator,
                            SystemFolderValidator systemFolderValidator,
                            QualityProfileExistsValidator qualityProfileExistsValidator,
                            MetadataProfileExistsValidator metadataProfileExistsValidator)
            : base(signalRBroadcaster)
        {
            _authorService           = authorService;
            _bookService             = bookService;
            _addAuthorService        = addAuthorService;
            _authorStatisticsService = authorStatisticsService;

            _coverMapper         = coverMapper;
            _commandQueueManager = commandQueueManager;
            _rootFolderService   = rootFolderService;

            GetResourceAll  = AllAuthors;
            GetResourceById = GetAuthor;
            CreateResource  = AddAuthor;
            UpdateResource  = UpdateAuthor;
            DeleteResource  = DeleteAuthor;

            Http.Validation.RuleBuilderExtensions.ValidId(SharedValidator.RuleFor(s => s.QualityProfileId));
            Http.Validation.RuleBuilderExtensions.ValidId(SharedValidator.RuleFor(s => s.MetadataProfileId));

            SharedValidator.RuleFor(s => s.Path)
            .Cascade(CascadeMode.StopOnFirstFailure)
            .IsValidPath()
            .SetValidator(rootFolderValidator)
            .SetValidator(mappedNetworkDriveValidator)
            .SetValidator(authorPathValidator)
            .SetValidator(authorAncestorValidator)
            .SetValidator(systemFolderValidator)
            .When(s => !s.Path.IsNullOrWhiteSpace());

            SharedValidator.RuleFor(s => s.QualityProfileId).SetValidator(qualityProfileExistsValidator);
            SharedValidator.RuleFor(s => s.MetadataProfileId).SetValidator(metadataProfileExistsValidator);

            PostValidator.RuleFor(s => s.Path).IsValidPath().When(s => s.RootFolderPath.IsNullOrWhiteSpace());
            PostValidator.RuleFor(s => s.RootFolderPath).IsValidPath().When(s => s.Path.IsNullOrWhiteSpace());
            PostValidator.RuleFor(s => s.AuthorName).NotEmpty();
            PostValidator.RuleFor(s => s.ForeignAuthorId).NotEmpty().SetValidator(authorExistsValidator);

            PutValidator.RuleFor(s => s.Path).IsValidPath();
        }
示例#6
0
 public AddBookService(IAuthorService authorService,
                       IAddAuthorService addAuthorService,
                       IBookService bookService,
                       IProvideBookInfo bookInfo,
                       IImportListExclusionService importListExclusionService,
                       Logger logger)
 {
     _authorService              = authorService;
     _addAuthorService           = addAuthorService;
     _bookService                = bookService;
     _bookInfo                   = bookInfo;
     _importListExclusionService = importListExclusionService;
     _logger = logger;
 }
示例#7
0
 public AuthorImportModule(IAddAuthorService addAuthorService)
     : base("/author/import")
 {
     _addAuthorService = addAuthorService;
     Post("/", x => Import());
 }