InternalItemsQuery.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. using MediaBrowser.Model.Entities;
  2. using System;
  3. using System.Collections.Generic;
  4. using MediaBrowser.Model.Configuration;
  5. namespace MediaBrowser.Controller.Entities
  6. {
  7. public class InternalItemsQuery
  8. {
  9. public bool Recursive { get; set; }
  10. public int? StartIndex { get; set; }
  11. public int? Limit { get; set; }
  12. public string[] SortBy { get; set; }
  13. public SortOrder SortOrder { get; set; }
  14. public User User { get; set; }
  15. public Func<BaseItem, bool> Filter { get; set; }
  16. public bool? IsFolder { get; set; }
  17. public bool? IsFavorite { get; set; }
  18. public bool? IsFavoriteOrLiked { get; set; }
  19. public bool? IsLiked { get; set; }
  20. public bool? IsPlayed { get; set; }
  21. public bool? IsResumable { get; set; }
  22. public bool? IncludeItemsByName { get; set; }
  23. public string[] MediaTypes { get; set; }
  24. public string[] IncludeItemTypes { get; set; }
  25. public string[] ExcludeItemTypes { get; set; }
  26. public string[] ExcludeTags { get; set; }
  27. public string[] Genres { get; set; }
  28. public bool? IsMissing { get; set; }
  29. public bool? IsUnaired { get; set; }
  30. public bool? IsVirtualUnaired { get; set; }
  31. public bool? CollapseBoxSetItems { get; set; }
  32. public string NameStartsWithOrGreater { get; set; }
  33. public string NameStartsWith { get; set; }
  34. public string NameLessThan { get; set; }
  35. public string NameContains { get; set; }
  36. public string Path { get; set; }
  37. public string Person { get; set; }
  38. public string[] PersonIds { get; set; }
  39. public string[] ItemIds { get; set; }
  40. public string AdjacentTo { get; set; }
  41. public string[] PersonTypes { get; set; }
  42. public bool? Is3D { get; set; }
  43. public bool? IsHD { get; set; }
  44. public bool? IsInBoxSet { get; set; }
  45. public bool? IsLocked { get; set; }
  46. public bool? IsPlaceHolder { get; set; }
  47. public bool? IsYearMismatched { get; set; }
  48. public bool? HasImdbId { get; set; }
  49. public bool? HasOverview { get; set; }
  50. public bool? HasTmdbId { get; set; }
  51. public bool? HasOfficialRating { get; set; }
  52. public bool? HasTvdbId { get; set; }
  53. public bool? HasThemeSong { get; set; }
  54. public bool? HasThemeVideo { get; set; }
  55. public bool? HasSubtitles { get; set; }
  56. public bool? HasSpecialFeature { get; set; }
  57. public bool? HasTrailer { get; set; }
  58. public bool? HasParentalRating { get; set; }
  59. public string[] Studios { get; set; }
  60. public string[] StudioIds { get; set; }
  61. public string[] GenreIds { get; set; }
  62. public ImageType[] ImageTypes { get; set; }
  63. public VideoType[] VideoTypes { get; set; }
  64. public UnratedItem[] BlockUnratedItems { get; set; }
  65. public int[] Years { get; set; }
  66. public string[] Tags { get; set; }
  67. public string[] OfficialRatings { get; set; }
  68. public DateTime? MinPremiereDate { get; set; }
  69. public DateTime? MaxPremiereDate { get; set; }
  70. public DateTime? MinStartDate { get; set; }
  71. public DateTime? MaxStartDate { get; set; }
  72. public DateTime? MinEndDate { get; set; }
  73. public DateTime? MaxEndDate { get; set; }
  74. public bool? IsAiring { get; set; }
  75. public bool? IsMovie { get; set; }
  76. public bool? IsSports { get; set; }
  77. public bool? IsKids { get; set; }
  78. public int? MinPlayers { get; set; }
  79. public int? MaxPlayers { get; set; }
  80. public int? MinIndexNumber { get; set; }
  81. public double? MinCriticRating { get; set; }
  82. public double? MinCommunityRating { get; set; }
  83. public string[] ChannelIds { get; set; }
  84. internal List<Guid> ItemIdsFromPersonFilters { get; set; }
  85. public int? MaxParentalRating { get; set; }
  86. public bool? IsCurrentSchema { get; set; }
  87. public bool? HasDeadParentId { get; set; }
  88. public bool? IsOffline { get; set; }
  89. public LocationType? LocationType { get; set; }
  90. public Guid? ParentId { get; set; }
  91. public string[] AncestorIds { get; set; }
  92. public string[] TopParentIds { get; set; }
  93. public LocationType[] ExcludeLocationTypes { get; set; }
  94. public string[] PresetViews { get; set; }
  95. public SourceType[] SourceTypes { get; set; }
  96. public SourceType[] ExcludeSourceTypes { get; set; }
  97. public TrailerType[] TrailerTypes { get; set; }
  98. public TrailerType[] ExcludeTrailerTypes { get; set; }
  99. public InternalItemsQuery()
  100. {
  101. BlockUnratedItems = new UnratedItem[] { };
  102. Tags = new string[] { };
  103. OfficialRatings = new string[] { };
  104. SortBy = new string[] { };
  105. MediaTypes = new string[] { };
  106. IncludeItemTypes = new string[] { };
  107. ExcludeItemTypes = new string[] { };
  108. Genres = new string[] { };
  109. Studios = new string[] { };
  110. StudioIds = new string[] { };
  111. GenreIds = new string[] { };
  112. ImageTypes = new ImageType[] { };
  113. VideoTypes = new VideoType[] { };
  114. Years = new int[] { };
  115. PersonTypes = new string[] { };
  116. PersonIds = new string[] { };
  117. ChannelIds = new string[] { };
  118. ItemIds = new string[] { };
  119. AncestorIds = new string[] { };
  120. TopParentIds = new string[] { };
  121. ExcludeTags = new string[] { };
  122. ExcludeLocationTypes = new LocationType[] { };
  123. PresetViews = new string[] { };
  124. SourceTypes = new SourceType[] { };
  125. ExcludeSourceTypes = new SourceType[] { };
  126. TrailerTypes = new TrailerType[] { };
  127. ExcludeTrailerTypes = new TrailerType[] { };
  128. }
  129. public InternalItemsQuery(User user)
  130. : this()
  131. {
  132. if (user != null)
  133. {
  134. var policy = user.Policy;
  135. MaxParentalRating = policy.MaxParentalRating;
  136. if (policy.MaxParentalRating.HasValue)
  137. {
  138. BlockUnratedItems = policy.BlockUnratedItems;
  139. }
  140. ExcludeTags = policy.BlockedTags;
  141. User = user;
  142. }
  143. }
  144. }
  145. }