public string GetImageLink(BasicInfo data, ImageSize imageSize) { if (_serviceConfigurationInfo is null) { _serviceConfigurationInfo = TmdbServiceConfiguration.Configuration; } _serviceConfigurationInfo.ThrowIfNull(nameof(_serviceConfigurationInfo)); if (!(data is TmdbMovieInfo movieInfo)) { throw new ArgumentException("Data handler has invalid type.", nameof(data)); } int sizeIndex = GetImageSizeIndex(imageSize, _serviceConfigurationInfo.PosterSizes.Count); string imageSizeValue = _serviceConfigurationInfo.PosterSizes[sizeIndex]; string result = _serviceConfigurationInfo.SecureBaseUrl + imageSizeValue + movieInfo.PosterPath; return(result); }
public TmdbImageSupplier(TmdbServiceConfigurationInfo serviceConfigurationInfo) { _serviceConfigurationInfo = serviceConfigurationInfo.ThrowIfNull(nameof(serviceConfigurationInfo)); }