public async void BeginLoadPosterByImdbId(TheTVDBClient client, string imdbId) { if (client == null) throw new ArgumentNullException(nameof(client)); if (imdbId == null) throw new ArgumentNullException(nameof(imdbId)); var videos = (await client.GetSeriesByImdbIdAsync(imdbId)).ToArray(); if (videos.Length == 0) { this.Load(Enumerable.Empty<string>()); } else { var urls = (await videos[0].GetBannersAsync(JryVideoCore.Current.GetTheTVDBClient())) .Where(z => z.BannerType == BannerType.Poster) .Select(z => z.BuildUrl(client)) .ToArray(); this.Load(urls); } }
private async Task<bool> AutoGenerateCoverAsync(TheTVDBClient client, IImdbItem item) { var imdbId = item.GetValidImdbId(); if (imdbId == null) return false; foreach (var series in await client.GetSeriesByImdbIdAsync(imdbId)) { if (await this.AutoGenerateCoverOverTheTVDBIdAsync(client, series.SeriesId, this.source.InfoView.Source.Index.ToString())) return true; } return false; }