本文整理汇总了C#中BaseItem.IsPlayed方法的典型用法代码示例。如果您正苦于以下问题:C# BaseItem.IsPlayed方法的具体用法?C# BaseItem.IsPlayed怎么用?C# BaseItem.IsPlayed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseItem
的用法示例。
在下文中一共展示了BaseItem.IsPlayed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValue
/// <summary>
/// Gets the date.
/// </summary>
/// <param name="x">The x.</param>
/// <returns>DateTime.</returns>
private int GetValue(BaseItem x)
{
return x.IsPlayed(User) ? 0 : 1;
}
示例2: ApplyAdditionalFilters
/// <summary> Applies the additional filters. </summary>
/// <param name="request"> The request. </param>
/// <param name="i"> Zero-based index of the. </param>
/// <param name="user"> The user. </param>
/// <param name="isPreFiltered"> true if this object is pre filtered. </param>
/// <param name="libraryManager"> Manager for library. </param>
/// <returns> true if it succeeds, false if it fails. </returns>
private bool ApplyAdditionalFilters(BaseReportRequest request, BaseItem i, User user, bool isPreFiltered, ILibraryManager libraryManager)
{
var video = i as Video;
if (!isPreFiltered)
{
var mediaTypes = request.GetMediaTypes();
if (mediaTypes.Length > 0)
{
if (!(!string.IsNullOrEmpty(i.MediaType) && mediaTypes.Contains(i.MediaType, StringComparer.OrdinalIgnoreCase)))
{
return false;
}
}
if (request.IsPlayed.HasValue)
{
var val = request.IsPlayed.Value;
if (i.IsPlayed(user) != val)
{
return false;
}
}
// Exclude item types
var excluteItemTypes = request.GetExcludeItemTypes();
if (excluteItemTypes.Length > 0 && excluteItemTypes.Contains(i.GetType().Name, StringComparer.OrdinalIgnoreCase))
{
return false;
}
// Include item types
var includeItemTypes = request.GetIncludeItemTypes();
if (includeItemTypes.Length > 0 && !includeItemTypes.Contains(i.GetType().Name, StringComparer.OrdinalIgnoreCase))
{
return false;
}
if (request.IsInBoxSet.HasValue)
{
var val = request.IsInBoxSet.Value;
if (i.Parents.OfType<BoxSet>().Any() != val)
{
return false;
}
}
// Filter by Video3DFormat
if (request.Is3D.HasValue)
{
var val = request.Is3D.Value;
if (video == null || val != video.Video3DFormat.HasValue)
{
return false;
}
}
if (request.IsHD.HasValue)
{
var val = request.IsHD.Value;
if (video == null || val != video.IsHD)
{
return false;
}
}
if (request.IsUnidentified.HasValue)
{
var val = request.IsUnidentified.Value;
if (i.IsUnidentified != val)
{
return false;
}
}
if (request.IsLocked.HasValue)
{
var val = request.IsLocked.Value;
if (i.IsLocked != val)
{
return false;
}
}
if (request.HasOverview.HasValue)
{
var filterValue = request.HasOverview.Value;
var hasValue = !string.IsNullOrEmpty(i.Overview);
if (hasValue != filterValue)
//.........这里部分代码省略.........