public TheTvDbSeriesParser(ITheTvDbActorParser actorParseService,
            ITheTvDbBannerParser bannerParseService,
            ITheTvDbEpisodeParser episodeParseService)
        {
            if (actorParseService == null) throw new ArgumentNullException(nameof(actorParseService));
            if (bannerParseService == null) throw new ArgumentNullException(nameof(bannerParseService));
            if (episodeParseService == null) throw new ArgumentNullException(nameof(episodeParseService));

            _actorParseService = actorParseService;
            _bannerParseService = bannerParseService;
            _episodeParseService = episodeParseService;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new instance with the provided api configuration
        /// </summary>
        /// <param name="apiConfiguration">The API configuration</param>
        public TheTvDbClient(ITheTvDbApiConfiguration apiConfiguration)
        {
            if (apiConfiguration == null)
                throw new ArgumentNullException(nameof(apiConfiguration));
            if (string.IsNullOrWhiteSpace(apiConfiguration.BaseUrl))
                throw new ArgumentOutOfRangeException(nameof(apiConfiguration), "Base url must be set");

            // Proxy Services
            _seriesServiceProxy = new TheTvDbSeriesServiceProxy(apiConfiguration);
            _episodeServiceProxy = new TheTvDbEpisodeServiceProxy(apiConfiguration);
            _updateServiceProxy = new TheTvDbUpdateServiceProxy(apiConfiguration);
            _bannerServiceProxy = new TheTvDbBannerServiceProxy(apiConfiguration);

            // Initialize parse services
            var actorParser = new TheTvDbActorParser();
            var bannerParser = new TheTvDbBannerParser();
            _episodeParser = new TheTvDbEpisodeParser();
            _seriesParser = new TheTvDbSeriesParser(actorParser, bannerParser, _episodeParser);
            _updateParser = new TheTvDbUpdateParser();
        }