private async Task AddImages(List <RemoteImageInfo> list, int seasonNumber, string path, CancellationToken cancellationToken) { var root = await _json.DeserializeFromFileAsync <FanartSeriesProvider.RootObject>(path).ConfigureAwait(false); if (root != null) { AddImages(list, root, seasonNumber, cancellationToken); } }
/// <summary> /// Adds the images. /// </summary> /// <param name="list">The list.</param> /// <param name="path">The path.</param> /// <param name="releaseId">The release identifier.</param> /// <param name="releaseGroupId">The release group identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> private async Task AddImages(List <RemoteImageInfo> list, string path, string releaseId, string releaseGroupId, CancellationToken cancellationToken) { var obj = await _jsonSerializer.DeserializeFromFileAsync <FanartArtistProvider.FanartArtistResponse>(path).ConfigureAwait(false); if (obj.albums != null) { var album = obj.albums.FirstOrDefault(i => string.Equals(i.release_group_id, releaseGroupId, StringComparison.OrdinalIgnoreCase)); if (album != null) { PopulateImages(list, album.albumcover, ImageType.Primary, 1000, 1000); PopulateImages(list, album.cdart, ImageType.Disc, 1000, 1000); } } }