public async Task <IEnumerable <RemoteImageInfo> > GetImages(BaseItem item, CancellationToken cancellationToken)
        {
            if (!TvdbSeriesProvider.IsValidSeries(item.ProviderIds))
            {
                return(Array.Empty <RemoteImageInfo>());
            }

            var language     = item.GetPreferredMetadataLanguage();
            var remoteImages = new List <RemoteImageInfo>();
            var keyTypes     = new[] { KeyType.Poster, KeyType.Series, KeyType.Fanart };
            var tvdbId       = Convert.ToInt32(item.GetProviderId(MetadataProviders.Tvdb));

            foreach (KeyType keyType in keyTypes)
            {
                var imageQuery = new ImagesQuery
                {
                    KeyType = keyType
                };
                try
                {
                    var imageResults =
                        await _tvDbClientManager.GetImagesAsync(tvdbId, imageQuery, language, cancellationToken)
                        .ConfigureAwait(false);

                    remoteImages.AddRange(GetImages(imageResults.Data, language));
                }
                catch (TvDbServerException)
                {
                    _logger.LogDebug("No images of type {KeyType} exist for series {TvDbId}", keyType,
                                     tvdbId);
                }
            }
            return(remoteImages);
        }
        public async Task <IEnumerable <RemoteImageInfo> > GetImages(BaseItem item, CancellationToken cancellationToken)
        {
            var season = (Season)item;
            var series = season.Series;

            if (series == null || !season.IndexNumber.HasValue || !TvdbSeriesProvider.IsValidSeries(series.ProviderIds))
            {
                return(new RemoteImageInfo[] { });
            }

            var tvdbId       = Convert.ToInt32(series.GetProviderId(MetadataProviders.Tvdb));
            var seasonNumber = season.IndexNumber.Value;
            var language     = item.GetPreferredMetadataLanguage();
            var remoteImages = new List <RemoteImageInfo>();

            var keyTypes = new[] { KeyType.Season, KeyType.Seasonwide, KeyType.Fanart };

            foreach (var keyType in keyTypes)
            {
                var imageQuery = new ImagesQuery
                {
                    KeyType = keyType,
                    SubKey  = seasonNumber.ToString()
                };
                try
                {
                    var imageResults = await _tvDbClientManager
                                       .GetImagesAsync(tvdbId, imageQuery, language, cancellationToken).ConfigureAwait(false);

                    remoteImages.AddRange(GetImages(imageResults.Data, language));
                }
                catch (TvDbServerException)
                {
                    _logger.LogDebug("No images of type {KeyType} found for series {TvdbId}", keyType, tvdbId);
                }
            }

            return(remoteImages);
        }