本文整理汇总了C#中Video.GetPreferredMetadataLanguage方法的典型用法代码示例。如果您正苦于以下问题:C# Video.GetPreferredMetadataLanguage方法的具体用法?C# Video.GetPreferredMetadataLanguage怎么用?C# Video.GetPreferredMetadataLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video.GetPreferredMetadataLanguage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Search
public Task<IEnumerable<RemoteChapterResult>> Search(Video video, CancellationToken cancellationToken)
{
VideoContentType mediaType;
if (video is Episode)
{
mediaType = VideoContentType.Episode;
}
else if (video is Movie)
{
mediaType = VideoContentType.Movie;
}
else
{
// These are the only supported types
return Task.FromResult<IEnumerable<RemoteChapterResult>>(new List<RemoteChapterResult>());
}
var request = new ChapterSearchRequest
{
ContentType = mediaType,
IndexNumber = video.IndexNumber,
Language = video.GetPreferredMetadataLanguage(),
MediaPath = video.Path,
Name = video.Name,
ParentIndexNumber = video.ParentIndexNumber,
ProductionYear = video.ProductionYear,
ProviderIds = video.ProviderIds,
RuntimeTicks = video.RunTimeTicks,
SearchAllProviders = false
};
var episode = video as Episode;
if (episode != null)
{
request.IndexNumberEnd = episode.IndexNumberEnd;
request.SeriesName = episode.SeriesName;
}
return Search(request, cancellationToken);
}