2
0

InternalItemsQuery.cs 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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 BaseItem SimilarTo { 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[] ExcludeInheritedTags { get; set; }
  28. public string[] Genres { get; set; }
  29. public string[] Keywords { get; set; }
  30. public bool? IsMissing { get; set; }
  31. public bool? IsUnaired { get; set; }
  32. public bool? IsVirtualUnaired { get; set; }
  33. public bool? CollapseBoxSetItems { get; set; }
  34. public string NameStartsWithOrGreater { get; set; }
  35. public string NameStartsWith { get; set; }
  36. public string NameLessThan { get; set; }
  37. public string NameContains { get; set; }
  38. public string PresentationUniqueKey { get; set; }
  39. public string Path { get; set; }
  40. public string Name { get; set; }
  41. public string SlugName { get; set; }
  42. public string Person { get; set; }
  43. public string[] PersonIds { get; set; }
  44. public string[] ItemIds { get; set; }
  45. public string[] ExcludeItemIds { get; set; }
  46. public string AdjacentTo { get; set; }
  47. public string[] PersonTypes { get; set; }
  48. public bool? Is3D { get; set; }
  49. public bool? IsHD { get; set; }
  50. public bool? IsInBoxSet { get; set; }
  51. public bool? IsLocked { get; set; }
  52. public bool? IsPlaceHolder { get; set; }
  53. public bool? HasImdbId { get; set; }
  54. public bool? HasOverview { get; set; }
  55. public bool? HasTmdbId { get; set; }
  56. public bool? HasOfficialRating { get; set; }
  57. public bool? HasTvdbId { get; set; }
  58. public bool? HasThemeSong { get; set; }
  59. public bool? HasThemeVideo { get; set; }
  60. public bool? HasSubtitles { get; set; }
  61. public bool? HasSpecialFeature { get; set; }
  62. public bool? HasTrailer { get; set; }
  63. public bool? HasParentalRating { get; set; }
  64. public string[] Studios { get; set; }
  65. public string[] StudioIds { get; set; }
  66. public string[] GenreIds { get; set; }
  67. public ImageType[] ImageTypes { get; set; }
  68. public VideoType[] VideoTypes { get; set; }
  69. public UnratedItem[] BlockUnratedItems { get; set; }
  70. public int[] Years { get; set; }
  71. public string[] Tags { get; set; }
  72. public string[] OfficialRatings { get; set; }
  73. public DateTime? MinPremiereDate { get; set; }
  74. public DateTime? MaxPremiereDate { get; set; }
  75. public DateTime? MinStartDate { get; set; }
  76. public DateTime? MaxStartDate { get; set; }
  77. public DateTime? MinEndDate { get; set; }
  78. public DateTime? MaxEndDate { get; set; }
  79. public bool? IsAiring { get; set; }
  80. public bool? IsMovie { get; set; }
  81. public bool? IsSports { get; set; }
  82. public bool? IsKids { get; set; }
  83. public int? MinPlayers { get; set; }
  84. public int? MaxPlayers { get; set; }
  85. public int? MinIndexNumber { get; set; }
  86. public int? AiredDuringSeason { get; set; }
  87. public double? MinCriticRating { get; set; }
  88. public double? MinCommunityRating { get; set; }
  89. public string[] ChannelIds { get; set; }
  90. internal List<Guid> ItemIdsFromPersonFilters { get; set; }
  91. public int? ParentIndexNumber { get; set; }
  92. public int? IndexNumber { get; set; }
  93. public int? MinParentalRating { get; set; }
  94. public int? MaxParentalRating { get; set; }
  95. public bool? IsCurrentSchema { get; set; }
  96. public bool? HasDeadParentId { get; set; }
  97. public bool? IsOffline { get; set; }
  98. public Guid? ParentId { get; set; }
  99. public string[] AncestorIds { get; set; }
  100. public string[] TopParentIds { get; set; }
  101. public LocationType[] LocationTypes { get; set; }
  102. public LocationType[] ExcludeLocationTypes { get; set; }
  103. public string[] PresetViews { get; set; }
  104. public SourceType[] SourceTypes { get; set; }
  105. public SourceType[] ExcludeSourceTypes { get; set; }
  106. public TrailerType[] TrailerTypes { get; set; }
  107. public DayOfWeek[] AirDays { get; set; }
  108. public SeriesStatus[] SeriesStatuses { get; set; }
  109. public string AlbumArtistStartsWithOrGreater { get; set; }
  110. public string[] AlbumNames { get; set; }
  111. public string[] ArtistNames { get; set; }
  112. public string AncestorWithPresentationUniqueKey { get; set; }
  113. public bool GroupByPresentationUniqueKey { get; set; }
  114. public bool EnableTotalRecordCount { get; set; }
  115. public bool ForceDirect { get; set; }
  116. public Dictionary<string,string> ExcludeProviderIds { get; set; }
  117. public InternalItemsQuery()
  118. {
  119. GroupByPresentationUniqueKey = true;
  120. EnableTotalRecordCount = true;
  121. AlbumNames = new string[] { };
  122. ArtistNames = new string[] { };
  123. ExcludeProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  124. BlockUnratedItems = new UnratedItem[] { };
  125. Tags = new string[] { };
  126. OfficialRatings = new string[] { };
  127. SortBy = new string[] { };
  128. MediaTypes = new string[] { };
  129. Keywords = new string[] { };
  130. IncludeItemTypes = new string[] { };
  131. ExcludeItemTypes = new string[] { };
  132. Genres = new string[] { };
  133. Studios = new string[] { };
  134. StudioIds = new string[] { };
  135. GenreIds = new string[] { };
  136. ImageTypes = new ImageType[] { };
  137. VideoTypes = new VideoType[] { };
  138. Years = new int[] { };
  139. PersonTypes = new string[] { };
  140. PersonIds = new string[] { };
  141. ChannelIds = new string[] { };
  142. ItemIds = new string[] { };
  143. ExcludeItemIds = new string[] { };
  144. AncestorIds = new string[] { };
  145. TopParentIds = new string[] { };
  146. ExcludeTags = new string[] { };
  147. ExcludeInheritedTags = new string[] { };
  148. LocationTypes = new LocationType[] { };
  149. ExcludeLocationTypes = new LocationType[] { };
  150. PresetViews = new string[] { };
  151. SourceTypes = new SourceType[] { };
  152. ExcludeSourceTypes = new SourceType[] { };
  153. TrailerTypes = new TrailerType[] { };
  154. AirDays = new DayOfWeek[] { };
  155. SeriesStatuses = new SeriesStatus[] { };
  156. }
  157. public InternalItemsQuery(User user)
  158. : this()
  159. {
  160. SetUser(user);
  161. }
  162. public void SetUser(User user)
  163. {
  164. if (user != null)
  165. {
  166. var policy = user.Policy;
  167. MaxParentalRating = policy.MaxParentalRating;
  168. if (policy.MaxParentalRating.HasValue)
  169. {
  170. BlockUnratedItems = policy.BlockUnratedItems;
  171. }
  172. ExcludeInheritedTags = policy.BlockedTags;
  173. User = user;
  174. }
  175. }
  176. }
  177. }