예제 #1
0
        /// <summary>
        /// Creates a new instance with the provided api configuration
        /// </summary>
        /// <param name="apiConfiguration">The API configuration</param>
        public TheTVDBManager(IApiConfiguration 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
            _seriesService  = new SeriesServiceProxy(apiConfiguration);
            _episodeService = new EpisodeServiceProxy(apiConfiguration);
            _updateService  = new UpdateServiceProxy(apiConfiguration);
            _bannerService  = new BannerServiceProxy(apiConfiguration);

            // Initialize parse services
            var actorParseService  = new ActorParseService();
            var bannerParseService = new BannerParseService();

            _episodeParseService = new EpisodeParseService();
            _seriesParseService  = new SeriesParseService(actorParseService, bannerParseService, _episodeParseService);
            _updateParseService  = new UpdateParseService();
        }
예제 #2
0
 public SeriesParseService(IActorParseService actorParseService,
                           IBannerParseService bannerParseService,
                           IEpisodeParseService episodeParseService)
 {
     _actorParseService   = actorParseService ?? throw new ArgumentNullException(nameof(actorParseService));
     _bannerParseService  = bannerParseService ?? throw new ArgumentNullException(nameof(bannerParseService));
     _episodeParseService = episodeParseService ?? throw new ArgumentNullException(nameof(episodeParseService));
 }