Ejemplo n.º 1
0
        public void InitAggregateIndexer()
        {
            logger.Info("Adding aggregate indexer");
            AggregateIndexer aggregateIndexer = new AggregateIndexer(this, logger, container.Resolve <IProtectionService>());

            this.aggregateIndexer = aggregateIndexer;
            UpdateAggregateIndexer();
        }
Ejemplo n.º 2
0
        public void InitAggregateIndexer()
        {
            logger.Info("Adding aggregate indexer");
            AggregateIndexer aggregateIndexer = new AggregateIndexer(this, container.Resolve <IWebClient>(), logger, container.Resolve <IProtectionService>());

            aggregateIndexer.SetIndexers(indexers.Where(p => p.Value.IsConfigured).Select(p => p.Value));

            this.aggregateIndexer = aggregateIndexer;
        }
Ejemplo n.º 3
0
        public void InitAggregateIndexer()
        {
            logger.Info("Adding aggregate indexer");
            AggregateIndexer aggregateIndexer = new AggregateIndexer(this, container.Resolve <IWebClient>(), logger, container.Resolve <IProtectionService>());

            aggregateIndexer.SetIndexers(indexers.Values);

            this.aggregateIndexer = aggregateIndexer;
        }
Ejemplo n.º 4
0
        public void InitMetaIndexers()
        {
            var(fallbackStrategyProvider, resultFilterProvider) = GetStrategyProviders();

            logger.Info("Adding aggregate indexer ('all' indexer) ...");
            aggregateIndexer = new AggregateIndexer(fallbackStrategyProvider, resultFilterProvider, configService, webClient, logger, protectionService, cacheService)
            {
                Indexers = indexers.Values
            };

            var predefinedFilters =
                new[] { "public", "private", "semi-public" }
            .Select(type => (filter: FilterFunc.Type.ToFilter(type), func: FilterFunc.Type.ToFunc(type)))
            .Concat(
                indexers.Values.SelectMany(x => x.Tags).Distinct()
                .Select(tag => (filter: FilterFunc.Tag.ToFilter(tag), func: FilterFunc.Tag.ToFunc(tag)))
                ).Select(x => new KeyValuePair <string, IWebIndexer>(x.filter, CreateFilterIndexer(x.filter, x.func)));

            availableFilters = new ConcurrentDictionary <string, IWebIndexer>(predefinedFilters);
        }
Ejemplo n.º 5
0
        public void InitAggregateIndexer()
        {
            var omdbApiKey = serverConfig.OmdbApiKey;
            IFallbackStrategyProvider fallbackStrategyProvider = null;
            IResultFilterProvider     resultFilterProvider     = null;

            if (!omdbApiKey.IsNullOrEmptyOrWhitespace())
            {
                var imdbResolver = new OmdbResolver(webClient, omdbApiKey.ToNonNull());
                fallbackStrategyProvider = new ImdbFallbackStrategyProvider(imdbResolver);
                resultFilterProvider     = new ImdbTitleResultFilterProvider(imdbResolver);
            }
            else
            {
                fallbackStrategyProvider = new NoFallbackStrategyProvider();
                resultFilterProvider     = new NoResultFilterProvider();
            }

            logger.Info("Adding aggregate indexer");
            aggregateIndexer          = new AggregateIndexer(fallbackStrategyProvider, resultFilterProvider, configService, webClient, logger, protectionService);
            aggregateIndexer.Indexers = indexers.Values;
        }
        public void InitAggregateIndexer()
        {
            var omdbApiKey = serverConfig.OmdbApiKey;
            IFallbackStrategyProvider fallbackStrategyProvider;
            IResultFilterProvider     resultFilterProvider;

            if (!string.IsNullOrWhiteSpace(omdbApiKey))
            {
                var imdbResolver = new OmdbResolver(webClient, omdbApiKey, serverConfig.OmdbApiUrl);
                fallbackStrategyProvider = new ImdbFallbackStrategyProvider(imdbResolver);
                resultFilterProvider     = new ImdbTitleResultFilterProvider(imdbResolver);
            }
            else
            {
                fallbackStrategyProvider = new NoFallbackStrategyProvider();
                resultFilterProvider     = new NoResultFilterProvider();
            }

            logger.Info("Adding aggregate indexer ('all' indexer) ...");
            aggregateIndexer = new AggregateIndexer(fallbackStrategyProvider, resultFilterProvider, configService, webClient, logger, protectionService)
            {
                Indexers = indexers.Values
            };
        }