예제 #1
0
        public Task <TVDBResponse <List <Image> > > GetImagesAsync(int seriesId, Action <ImagesQuery> query, CancellationToken cancellationToken = default)
        {
            if (query is null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            var imageQuery = new ImagesQuery();

            query(imageQuery);

            return(GetImagesAsync(seriesId, imageQuery, cancellationToken));
        }
예제 #2
0
        public async Task <TVDBResponse <List <Image> > > GetImagesAsync(int seriesId, ImagesQuery query, CancellationToken cancellationToken = default)
        {
            var response = await GetJsonAsync <TVDBResponse <List <Image> > >($"/series/{seriesId}/images/query?{query.ToQueryParams()}", cancellationToken).ConfigureAwait(false);

            if (_options.ReturnCompleteUrlForImages && response.Data != null)
            {
                foreach (var image in response.Data)
                {
                    image.FileName = ImageConverter.CheckAndConvertToCompleteUrl(image.FileName);
                }
            }

            return(response);
        }