ItemQuery.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. using MediaBrowser.Model.Entities;
  2. using System;
  3. namespace MediaBrowser.Model.Querying
  4. {
  5. /// <summary>
  6. /// Contains all the possible parameters that can be used to query for items
  7. /// </summary>
  8. public class ItemQuery
  9. {
  10. /// <summary>
  11. /// The user to localize search results for
  12. /// </summary>
  13. /// <value>The user id.</value>
  14. public string UserId { get; set; }
  15. /// <summary>
  16. /// Specify this to localize the search to a specific item or folder. Omit to use the root.
  17. /// </summary>
  18. /// <value>The parent id.</value>
  19. public string ParentId { get; set; }
  20. /// <summary>
  21. /// Skips over a given number of items within the results. Use for paging.
  22. /// </summary>
  23. /// <value>The start index.</value>
  24. public int? StartIndex { get; set; }
  25. /// <summary>
  26. /// The maximum number of items to return
  27. /// </summary>
  28. /// <value>The limit.</value>
  29. public int? Limit { get; set; }
  30. /// <summary>
  31. /// What to sort the results by
  32. /// </summary>
  33. /// <value>The sort by.</value>
  34. public string[] SortBy { get; set; }
  35. /// <summary>
  36. /// Filter by artists
  37. /// </summary>
  38. /// <value>The artists.</value>
  39. public string[] Artists { get; set; }
  40. /// <summary>
  41. /// The sort order to return results with
  42. /// </summary>
  43. /// <value>The sort order.</value>
  44. public SortOrder? SortOrder { get; set; }
  45. /// <summary>
  46. /// Filters to apply to the results
  47. /// </summary>
  48. /// <value>The filters.</value>
  49. public ItemFilter[] Filters { get; set; }
  50. /// <summary>
  51. /// Fields to return within the items, in addition to basic information
  52. /// </summary>
  53. /// <value>The fields.</value>
  54. public ItemFields[] Fields { get; set; }
  55. /// <summary>
  56. /// Gets or sets the media types.
  57. /// </summary>
  58. /// <value>The media types.</value>
  59. public string[] MediaTypes { get; set; }
  60. /// <summary>
  61. /// Gets or sets the video formats.
  62. /// </summary>
  63. /// <value>The video formats.</value>
  64. public bool? Is3D { get; set; }
  65. /// <summary>
  66. /// Gets or sets the video types.
  67. /// </summary>
  68. /// <value>The video types.</value>
  69. public VideoType[] VideoTypes { get; set; }
  70. /// <summary>
  71. /// Whether or not to perform the query recursively
  72. /// </summary>
  73. /// <value><c>true</c> if recursive; otherwise, <c>false</c>.</value>
  74. public bool Recursive { get; set; }
  75. /// <summary>
  76. /// Limit results to items containing specific genres
  77. /// </summary>
  78. /// <value>The genres.</value>
  79. public string[] Genres { get; set; }
  80. /// <summary>
  81. /// Limit results to items containing specific genres
  82. /// </summary>
  83. /// <value>The genres.</value>
  84. public string[] AllGenres { get; set; }
  85. /// <summary>
  86. /// Limit results to items containing specific studios
  87. /// </summary>
  88. /// <value>The studios.</value>
  89. public string[] Studios { get; set; }
  90. /// <summary>
  91. /// Gets or sets the exclude item types.
  92. /// </summary>
  93. /// <value>The exclude item types.</value>
  94. public string[] ExcludeItemTypes { get; set; }
  95. /// <summary>
  96. /// Gets or sets the include item types.
  97. /// </summary>
  98. /// <value>The include item types.</value>
  99. public string[] IncludeItemTypes { get; set; }
  100. /// <summary>
  101. /// Limit results to items containing specific years
  102. /// </summary>
  103. /// <value>The years.</value>
  104. public int[] Years { get; set; }
  105. /// <summary>
  106. /// Limit results to items containing a specific person
  107. /// </summary>
  108. /// <value>The person.</value>
  109. public string Person { get; set; }
  110. /// <summary>
  111. /// If the Person filter is used, this can also be used to restrict to a specific person type
  112. /// </summary>
  113. /// <value>The type of the person.</value>
  114. public string[] PersonTypes { get; set; }
  115. /// <summary>
  116. /// Search characters used to find items
  117. /// </summary>
  118. /// <value>The index by.</value>
  119. public string SearchTerm { get; set; }
  120. /// <summary>
  121. /// Gets or sets the image types.
  122. /// </summary>
  123. /// <value>The image types.</value>
  124. public ImageType[] ImageTypes { get; set; }
  125. /// <summary>
  126. /// Gets or sets the air days.
  127. /// </summary>
  128. /// <value>The air days.</value>
  129. public DayOfWeek[] AirDays { get; set; }
  130. /// <summary>
  131. /// Gets or sets the series status.
  132. /// </summary>
  133. /// <value>The series status.</value>
  134. public SeriesStatus[] SeriesStatuses { get; set; }
  135. /// <summary>
  136. /// Gets or sets the ids, which are specific items to retrieve
  137. /// </summary>
  138. /// <value>The ids.</value>
  139. public string[] Ids { get; set; }
  140. /// <summary>
  141. /// Gets or sets the min official rating.
  142. /// </summary>
  143. /// <value>The min official rating.</value>
  144. public string MinOfficialRating { get; set; }
  145. /// <summary>
  146. /// Gets or sets the max official rating.
  147. /// </summary>
  148. /// <value>The max official rating.</value>
  149. public string MaxOfficialRating { get; set; }
  150. /// <summary>
  151. /// Gets or sets the min index number.
  152. /// </summary>
  153. /// <value>The min index number.</value>
  154. public int? MinIndexNumber { get; set; }
  155. /// <summary>
  156. /// Gets or sets a value indicating whether this instance has parental rating.
  157. /// </summary>
  158. /// <value><c>null</c> if [has parental rating] contains no value, <c>true</c> if [has parental rating]; otherwise, <c>false</c>.</value>
  159. public bool? HasParentalRating { get; set; }
  160. /// <summary>
  161. /// Gets or sets a value indicating whether this instance is HD.
  162. /// </summary>
  163. /// <value><c>null</c> if [is HD] contains no value, <c>true</c> if [is HD]; otherwise, <c>false</c>.</value>
  164. public bool? IsHD { get; set; }
  165. /// <summary>
  166. /// Gets or sets the parent index number.
  167. /// </summary>
  168. /// <value>The parent index number.</value>
  169. public int? ParentIndexNumber { get; set; }
  170. /// <summary>
  171. /// Gets or sets the min players.
  172. /// </summary>
  173. /// <value>The min players.</value>
  174. public int? MinPlayers { get; set; }
  175. /// <summary>
  176. /// Gets or sets the max players.
  177. /// </summary>
  178. /// <value>The max players.</value>
  179. public int? MaxPlayers { get; set; }
  180. /// <summary>
  181. /// Gets or sets the name starts with or greater.
  182. /// </summary>
  183. /// <value>The name starts with or greater.</value>
  184. public string NameStartsWithOrGreater { get; set; }
  185. /// <summary>
  186. /// Gets or sets the name starts with.
  187. /// </summary>
  188. /// <value>The name starts with or greater.</value>
  189. public string NameStartsWith { get; set; }
  190. /// <summary>
  191. /// Gets or sets the name starts with.
  192. /// </summary>
  193. /// <value>The name lessthan.</value>
  194. public string NameLessThan { get; set; }
  195. /// <summary>
  196. /// Gets or sets the album artist starts with or greater.
  197. /// </summary>
  198. /// <value>The album artist starts with or greater.</value>
  199. public string AlbumArtistStartsWithOrGreater { get; set; }
  200. /// <summary>
  201. /// Gets or sets a value indicating whether [include index containers].
  202. /// </summary>
  203. /// <value><c>true</c> if [include index containers]; otherwise, <c>false</c>.</value>
  204. public bool IncludeIndexContainers { get; set; }
  205. /// <summary>
  206. /// Gets or sets the location types.
  207. /// </summary>
  208. /// <value>The location types.</value>
  209. public LocationType[] LocationTypes { get; set; }
  210. /// <summary>
  211. /// Gets or sets a value indicating whether this instance is missing episode.
  212. /// </summary>
  213. /// <value><c>null</c> if [is missing episode] contains no value, <c>true</c> if [is missing episode]; otherwise, <c>false</c>.</value>
  214. public bool? IsMissing { get; set; }
  215. /// <summary>
  216. /// Gets or sets a value indicating whether this instance is unaired episode.
  217. /// </summary>
  218. /// <value><c>null</c> if [is unaired episode] contains no value, <c>true</c> if [is unaired episode]; otherwise, <c>false</c>.</value>
  219. public bool? IsUnaired { get; set; }
  220. public bool? IsVirtualUnaired { get; set; }
  221. public bool? IsInBoxSet { get; set; }
  222. public bool? CollapseBoxSetItems { get; set; }
  223. public bool? IsPlayed { get; set; }
  224. /// <summary>
  225. /// Gets or sets the exclude location types.
  226. /// </summary>
  227. /// <value>The exclude location types.</value>
  228. public LocationType[] ExcludeLocationTypes { get; set; }
  229. public double? MinCommunityRating { get; set; }
  230. public double? MinCriticRating { get; set; }
  231. public int? AiredDuringSeason { get; set; }
  232. public DateTime? MinPremiereDate { get; set; }
  233. public DateTime? MaxPremiereDate { get; set; }
  234. public bool? EnableImages { get; set; }
  235. public int? ImageTypeLimit { get; set; }
  236. public ImageType[] EnableImageTypes { get; set; }
  237. /// <summary>
  238. /// Initializes a new instance of the <see cref="ItemQuery" /> class.
  239. /// </summary>
  240. public ItemQuery()
  241. {
  242. LocationTypes = new LocationType[] { };
  243. ExcludeLocationTypes = new LocationType[] { };
  244. SortBy = new string[] { };
  245. Filters = new ItemFilter[] { };
  246. Fields = new ItemFields[] { };
  247. MediaTypes = new string[] { };
  248. VideoTypes = new VideoType[] { };
  249. Genres = new string[] { };
  250. Studios = new string[] { };
  251. IncludeItemTypes = new string[] { };
  252. ExcludeItemTypes = new string[] { };
  253. Years = new int[] { };
  254. PersonTypes = new string[] { };
  255. Ids = new string[] { };
  256. Artists = new string[] { };
  257. ImageTypes = new ImageType[] { };
  258. AirDays = new DayOfWeek[] { };
  259. SeriesStatuses = new SeriesStatus[] { };
  260. EnableImageTypes = new ImageType[] { };
  261. }
  262. }
  263. }