本文整理汇总了C#中IApiClient.GetBackdropImageUrls方法的典型用法代码示例。如果您正苦于以下问题:C# IApiClient.GetBackdropImageUrls方法的具体用法?C# IApiClient.GetBackdropImageUrls怎么用?C# IApiClient.GetBackdropImageUrls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IApiClient
的用法示例。
在下文中一共展示了IApiClient.GetBackdropImageUrls方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDtoImage
private static object GetDtoImage(BaseItemDto item, string imageType, IApiClient apiClient)
{
if (item.ImageTags.IsNullOrEmpty() && item.BackdropImageTags.IsNullOrEmpty())
{
return "";
}
var imageOptions = new ImageOptions
{
EnableImageEnhancers = App.SpecificSettings.EnableImageEnhancers,
Quality = Constants.ImageQuality,
MaxHeight = 336,
ImageType = ImageType.Primary
};
if (item.Type == "Recording")
{
imageOptions.MaxHeight = 250;
}
else if (item.Type == "Program")
{
imageOptions.MaxHeight = 250;
}
else if (imageType.Equals("logo", StringComparison.OrdinalIgnoreCase))
{
imageOptions.ImageType = ImageType.Logo;
}
else if (imageType.Equals("backdrop"))
{
imageOptions.MaxHeight = 800;
imageOptions.ImageType = ImageType.Backdrop;
var images = apiClient.GetBackdropImageUrls(item, imageOptions);
if (!images.IsNullOrEmpty())
{
return images.FirstOrDefault();
}
}
else if (imageType.Equals("primaryorbackdrop"))
{
if (!item.HasPrimaryImage)
{
imageOptions.MaxHeight = 800;
imageOptions.ImageType = ImageType.Backdrop;
var images = apiClient.GetBackdropImageUrls(item, imageOptions);
if (!images.IsNullOrEmpty())
{
return images.FirstOrDefault();
}
}
}
else if (imageType.Equals("backdropsmall", StringComparison.OrdinalIgnoreCase))
{
imageOptions.MaxHeight = 336;
imageOptions.ImageType = ImageType.Backdrop;
var images = apiClient.GetBackdropImageUrls(item, imageOptions);
if (!images.IsNullOrEmpty())
{
return images.FirstOrDefault();
}
}
else if (imageType.Equals("banner", StringComparison.OrdinalIgnoreCase))
{
imageOptions.MaxHeight = 140;
imageOptions.ImageType = ImageType.Banner;
}
else if (imageType.Equals("art", StringComparison.OrdinalIgnoreCase))
{
imageOptions.ImageType = ImageType.Art;
}
else if (imageType.Equals("thumbnail", StringComparison.OrdinalIgnoreCase))
{
imageOptions.ImageType = ImageType.Thumb;
}
else if (imageType.Equals("icon", StringComparison.OrdinalIgnoreCase))
{
imageOptions.MaxHeight = 159;
}
else if (imageType.Equals("poster", StringComparison.OrdinalIgnoreCase))
{
imageOptions.MaxHeight = 675;
}
else if (imageType.Equals("episode", StringComparison.OrdinalIgnoreCase))
{
imageOptions.MaxHeight = 382;
}
else
{
imageOptions.MaxHeight = 300;
}
try
{
string url = item.Type == "Series" ? apiClient.GetImageUrl(item.Id, imageOptions) : apiClient.GetImageUrl(item, imageOptions);
return url;
}
catch
{
return "";
//.........这里部分代码省略.........