GetBannersBySeriesIdAsync() public method

public GetBannersBySeriesIdAsync ( string seriesId ) : Task>
seriesId string
return Task>
        private async Task<bool> LoadFanartByImdbIdAsync(TheTVDBClient client, RemoteId id, string index = null)
        {
            var seriesId = await client.TryGetTheTVDBSeriesIdByRemoteIdAsync(id);
            if (seriesId == null) return false;

            var urls = (await client.GetBannersBySeriesIdAsync(seriesId)).Where(z => z.BannerType == BannerType.Fanart)
                .Where(z => index == null || z.Season == index)
                .Select(z => z.BuildUrl(client))
                .ToArray();
            if (urls.Length > 0)
            {
                this.Load(urls);
                return true;
            }
            return false;
        }
Exemplo n.º 2
0
 public async Task <IEnumerable <Banner> > GetBannersAsync(TheTVDBClient client)
 => await client.GetBannersBySeriesIdAsync(this.Id);
Exemplo n.º 3
0
            private async Task<bool> AutoGenerateCoverOverTheTVDBIdAsync(TheTVDBClient client, string theTVDBId, string index)
            {
                if (theTVDBId.IsNullOrWhiteSpace()) return false;

                return await Task.Run(async () =>
                {
                    var array = (await client.GetBannersBySeriesIdAsync(theTVDBId)).ToArray();
                    var urls = array.Where(z => z.Season == index).RandomSort()
                        .Concat(array.Where(z => z.Season != index).RandomSort())
                        .Where(banner => banner.BannerType == BannerType.Fanart)
                        .Select(z => z.BuildUrl(client))
                        .ToArray();
                    if (urls.Length == 0) return false;
                    var builder = CoverBuilder.CreateBackground(this.source.InfoView.Source);
                    builder.Uri.AddRange(urls);
                    return await this.coverManager.BuildCoverAsync(builder);
                });
            }
Exemplo n.º 4
0
 public async Task<IEnumerable<Banner>> GetBannersAsync(TheTVDBClient client)
     => await client.GetBannersBySeriesIdAsync(this.Id);