/// <summary> /// Initializes instance according to parameter values. /// </summary> /// <param name="apiKey">Key to get access to TMDb service.</param> /// <param name="maxRetryCount">Maximum retry number to get response from TMDb.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="apiKey" /> is <c>null</c>. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="apiKey" /> presents empty string or contains only whitespaces. /// </exception> public TmdbCrawlerAsync(string apiKey, int maxRetryCount) { apiKey.ThrowIfNullOrWhiteSpace(nameof(apiKey)); _tmdbClient = TmdbClientFactory.CreateClient(apiKey, maxRetryCount); _searchResults = new HashSet <BasicInfo>(); }
public TmdbMovieSearchService( ITmdbClient client, GenreProvider genreProvider, KeywordProvider keywordProvider, MovieProvider movieProvider) { _Client = client; _GenreProvider = genreProvider; _KeywordProvider = keywordProvider; _MovieProvider = movieProvider; }
public GenresService(IMoviesRepository moviesRepository, ITmdbClient client, IGenresMapper mapper) { if (moviesRepository == null) { throw new ArgumentNullException(nameof(moviesRepository)); } if (client == null) { throw new ArgumentNullException(nameof(client)); } if (mapper == null) { throw new ArgumentNullException(nameof(mapper)); } _moviesRepository = moviesRepository; _client = client; _mapper = mapper; _moviesRepository = moviesRepository; }
public MoviesService(IMoviesRepository moviesRepository, IOmdbClient omdbClient, ITmdbClient tmdbClient, IMoviesMapper moviesMapper, IMoviesRequestsCache requestsCache) { if (moviesRepository == null) { throw new ArgumentNullException(nameof(moviesRepository)); } if (omdbClient == null) { throw new ArgumentNullException(nameof(omdbClient)); } if (tmdbClient == null) { throw new ArgumentNullException(nameof(tmdbClient)); } if (moviesMapper == null) { throw new ArgumentNullException(nameof(moviesMapper)); } if (requestsCache == null) { throw new ArgumentNullException(nameof(requestsCache)); } _moviesRepository = moviesRepository; _omdbClient = omdbClient; _tmdbClient = tmdbClient; _moviesMapper = moviesMapper; _requestsCache = requestsCache; }
public TmdbMoviesService(ITmdbClient tmdbClient) { _tmdbClient = tmdbClient; }
public TmdbService(ITmdbClient client, IMapper mapper, ImdbContext context) { this.client = client ?? throw new ArgumentNullException(nameof(client)); this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); this.context = context ?? throw new ArgumentNullException(nameof(context)); }
public MovieProvider(ITmdbClient client, SimpleCache <MovieSearchResultItem> cache) { _Client = client; _Cache = cache; }
public async Task <MovieDetailsResultItem> Execute(ITmdbClient client) => await client.GetResult <MovieDetailsResultItem>( Url(client.Config), _Request);
public async Task <PagedResultList <KeywordResultItem> > Execute(ITmdbClient client) => await client.GetResult <PagedResultList <KeywordResultItem> >( Url(client.Config), _Request);
/// <summary> /// Initializes instance according to parameter values. /// </summary> /// <param name="apiKey">Key to get access to TMDb service.</param> /// <param name="maxRetryCount">Maximum retry number to get response from TMDb.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="apiKey" /> is <c>null</c>. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="apiKey" /> presents empty string or contains only whitespaces. /// </exception> public TmdbCrawler(string apiKey, int maxRetryCount) { apiKey.ThrowIfNullOrWhiteSpace(nameof(apiKey)); _tmdbClient = TmdbClientFactory.CreateClient(apiKey, maxRetryCount); }
public KeywordProvider(ITmdbClient client, SimpleCache <KeywordResultItem> cache) { _Client = client; _Cache = cache; }
public GenreProvider(ITmdbClient client, SimpleCache <GenreResultList.GenreEntry> cache) { _Client = client; _Cache = cache; _Initialized = false; }
public async Task <GenreResultList> Execute(ITmdbClient client) => await client.GetResult <GenreResultList>( Url(client.Config), _Request);