ItemQuery.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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 VideoFormat[] VideoFormats { 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 studios
  82. /// </summary>
  83. /// <value>The studios.</value>
  84. public string[] Studios { get; set; }
  85. /// <summary>
  86. /// Gets or sets the exclude item types.
  87. /// </summary>
  88. /// <value>The exclude item types.</value>
  89. public string[] ExcludeItemTypes { get; set; }
  90. /// <summary>
  91. /// Gets or sets the include item types.
  92. /// </summary>
  93. /// <value>The include item types.</value>
  94. public string[] IncludeItemTypes { get; set; }
  95. /// <summary>
  96. /// Limit results to items containing specific years
  97. /// </summary>
  98. /// <value>The years.</value>
  99. public int[] Years { get; set; }
  100. /// <summary>
  101. /// Limit results to items containing a specific person
  102. /// </summary>
  103. /// <value>The person.</value>
  104. public string Person { get; set; }
  105. /// <summary>
  106. /// If the Person filter is used, this can also be used to restrict to a specific person type
  107. /// </summary>
  108. /// <value>The type of the person.</value>
  109. public string[] PersonTypes { get; set; }
  110. /// <summary>
  111. /// Search characters used to find items
  112. /// </summary>
  113. /// <value>The index by.</value>
  114. public string SearchTerm { get; set; }
  115. /// <summary>
  116. /// The dynamic, localized index function name
  117. /// </summary>
  118. /// <value>The index by.</value>
  119. public string IndexBy { 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. /// Initializes a new instance of the <see cref="ItemQuery"/> class.
  152. /// </summary>
  153. public ItemQuery()
  154. {
  155. SortBy = new string[] {};
  156. Filters = new ItemFilter[] {};
  157. Fields = new ItemFields[] {};
  158. MediaTypes = new string[] {};
  159. VideoFormats = new VideoFormat[] { };
  160. VideoTypes = new VideoType[] {};
  161. Genres = new string[] { };
  162. Studios = new string[] { };
  163. IncludeItemTypes = new string[] { };
  164. ExcludeItemTypes = new string[] { };
  165. Years = new int[] { };
  166. PersonTypes = new string[] { };
  167. Ids = new string[] { };
  168. Artists = new string[] { };
  169. ImageTypes = new ImageType[] { };
  170. AirDays = new DayOfWeek[] { };
  171. SeriesStatuses = new SeriesStatus[] { };
  172. }
  173. }
  174. }