public async Task <IEnumerable <RemoteImageInfo> > GetImages(string aid, CancellationToken cancellationToken) { var list = new List <RemoteImageInfo>(); if (!string.IsNullOrEmpty(aid)) { var primary = ProxerApi.Get_ImageUrl(await ProxerApi.WebRequestAPI(ProxerApi.Proxer_anime_link + aid)); list.Add(new RemoteImageInfo { ProviderName = Name, Type = ImageType.Primary, Url = await primary }); } return(list); }
public async Task <MetadataResult <Series> > GetMetadata(SeriesInfo info, CancellationToken cancellationToken) { var result = new MetadataResult <Series>(); var aid = info.ProviderIds.GetOrDefault(provider_name); if (string.IsNullOrEmpty(aid)) { _log.LogInformation("Start Proxer... Searching({Name})", info.Name); aid = await ProxerApi.FindSeries(info.Name, cancellationToken); } if (!string.IsNullOrEmpty(aid)) { string WebContent = await ProxerApi.WebRequestAPI(ProxerApi.Proxer_anime_link + aid); result.Item = new Series(); result.HasMetadata = true; result.Item.ProviderIds.Add(provider_name, aid); result.Item.Overview = await ProxerApi.Get_Overview(WebContent); result.ResultLanguage = "ger"; try { result.Item.CommunityRating = float.Parse(await ProxerApi.Get_Rating(WebContent), System.Globalization.CultureInfo.InvariantCulture); } catch (Exception) { } foreach (var genre in await ProxerApi.Get_Genre(WebContent)) { result.Item.AddGenre(genre); } GenreHelper.CleanupGenres(result.Item); StoreImageUrl(aid, await ProxerApi.Get_ImageUrl(WebContent), "image"); } return(result); }