当前位置: 首页>>代码示例>>C#>>正文


C# BaseItem.IsPlayed方法代码示例

本文整理汇总了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;
 }
开发者ID:jscorrea,项目名称:MediaBrowser,代码行数:9,代码来源:IsUnplayedComparer.cs

示例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)
//.........这里部分代码省略.........
开发者ID:redteamcpu,项目名称:Emby,代码行数:101,代码来源:ReportsService.cs


注:本文中的BaseItem.IsPlayed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。