ItemQuery.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. /// The dynamic, localized index function name
  122. /// </summary>
  123. /// <value>The index by.</value>
  124. public string IndexBy { get; set; }
  125. /// <summary>
  126. /// Gets or sets the image types.
  127. /// </summary>
  128. /// <value>The image types.</value>
  129. public ImageType[] ImageTypes { get; set; }
  130. /// <summary>
  131. /// Gets or sets the air days.
  132. /// </summary>
  133. /// <value>The air days.</value>
  134. public DayOfWeek[] AirDays { get; set; }
  135. /// <summary>
  136. /// Gets or sets the series status.
  137. /// </summary>
  138. /// <value>The series status.</value>
  139. public SeriesStatus[] SeriesStatuses { get; set; }
  140. /// <summary>
  141. /// Gets or sets the ids, which are specific items to retrieve
  142. /// </summary>
  143. /// <value>The ids.</value>
  144. public string[] Ids { get; set; }
  145. /// <summary>
  146. /// Gets or sets the min official rating.
  147. /// </summary>
  148. /// <value>The min official rating.</value>
  149. public string MinOfficialRating { get; set; }
  150. /// <summary>
  151. /// Gets or sets the max official rating.
  152. /// </summary>
  153. /// <value>The max official rating.</value>
  154. public string MaxOfficialRating { get; set; }
  155. /// <summary>
  156. /// Gets or sets the min index number.
  157. /// </summary>
  158. /// <value>The min index number.</value>
  159. public int? MinIndexNumber { get; set; }
  160. /// <summary>
  161. /// Gets or sets a value indicating whether this instance has parental rating.
  162. /// </summary>
  163. /// <value><c>null</c> if [has parental rating] contains no value, <c>true</c> if [has parental rating]; otherwise, <c>false</c>.</value>
  164. public bool? HasParentalRating { get; set; }
  165. /// <summary>
  166. /// Gets or sets a value indicating whether this instance is HD.
  167. /// </summary>
  168. /// <value><c>null</c> if [is HD] contains no value, <c>true</c> if [is HD]; otherwise, <c>false</c>.</value>
  169. public bool? IsHD { get; set; }
  170. /// <summary>
  171. /// Gets or sets the parent index number.
  172. /// </summary>
  173. /// <value>The parent index number.</value>
  174. public int? ParentIndexNumber { get; set; }
  175. /// <summary>
  176. /// Initializes a new instance of the <see cref="ItemQuery" /> class.
  177. /// </summary>
  178. public ItemQuery()
  179. {
  180. SortBy = new string[] {};
  181. Filters = new ItemFilter[] {};
  182. Fields = new ItemFields[] {};
  183. MediaTypes = new string[] {};
  184. VideoTypes = new VideoType[] {};
  185. Genres = new string[] { };
  186. Studios = new string[] { };
  187. IncludeItemTypes = new string[] { };
  188. ExcludeItemTypes = new string[] { };
  189. Years = new int[] { };
  190. PersonTypes = new string[] { };
  191. Ids = new string[] { };
  192. Artists = new string[] { };
  193. ImageTypes = new ImageType[] { };
  194. AirDays = new DayOfWeek[] { };
  195. SeriesStatuses = new SeriesStatus[] { };
  196. }
  197. }
  198. }