diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-07 15:12:39 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-07 15:12:39 -0500 |
| commit | 650dc0ccac5bbb372f644d6c383fbc88af4f4e7b (patch) | |
| tree | 58e8393f10ca4071fe7f5b61fd8ed7dd7aee3b7e /MediaBrowser.Model | |
| parent | 5392ff4da4794a0c4268baa61572a8cd881db379 (diff) | |
added new search params
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/ApiClient/IApiClient.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Model/MediaBrowser.Model.csproj | 1 | ||||
| -rw-r--r-- | MediaBrowser.Model/Search/SearchQuery.cs | 45 |
3 files changed, 50 insertions, 7 deletions
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index 9fdcf9150..c5b5311b2 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -107,13 +107,9 @@ namespace MediaBrowser.Model.ApiClient /// <summary> /// Gets the search hints async. /// </summary> - /// <param name="userId">The user id.</param> - /// <param name="searchTerm">The search term.</param> - /// <param name="startIndex">The start index.</param> - /// <param name="limit">The limit.</param> + /// <param name="query">The query.</param> /// <returns>Task{SearchHintResult}.</returns> - Task<SearchHintResult> GetSearchHintsAsync(string userId, string searchTerm, int? startIndex = null, - int? limit = null); + Task<SearchHintResult> GetSearchHintsAsync(SearchQuery query); /// <summary> /// Gets the theme videos async. @@ -682,8 +678,9 @@ namespace MediaBrowser.Model.ApiClient /// <typeparam name="T"></typeparam> /// <param name="url">The URL.</param> /// <param name="args">The args.</param> + /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{``0}.</returns> - Task<T> PostAsync<T>(string url, Dictionary<string, string> args) + Task<T> PostAsync<T>(string url, Dictionary<string, string> args, CancellationToken cancellationToken) where T : class; /// <summary> diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index ab91416b7..fff999172 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -115,6 +115,7 @@ <Compile Include="Querying\SessionQuery.cs" /> <Compile Include="Querying\SimilarItemsQuery.cs" /> <Compile Include="Querying\UserQuery.cs" /> + <Compile Include="Search\SearchQuery.cs" /> <Compile Include="Session\BrowseRequest.cs" /> <Compile Include="Session\MessageCommand.cs" /> <Compile Include="Session\PlayRequest.cs" /> diff --git a/MediaBrowser.Model/Search/SearchQuery.cs b/MediaBrowser.Model/Search/SearchQuery.cs new file mode 100644 index 000000000..87ff7af66 --- /dev/null +++ b/MediaBrowser.Model/Search/SearchQuery.cs @@ -0,0 +1,45 @@ + +namespace MediaBrowser.Model.Search +{ + public class SearchQuery + { + /// <summary> + /// The user to localize search results for + /// </summary> + /// <value>The user id.</value> + public string UserId { get; set; } + + /// <summary> + /// Gets or sets the search term. + /// </summary> + /// <value>The search term.</value> + public string SearchTerm { get; set; } + + /// <summary> + /// Skips over a given number of items within the results. Use for paging. + /// </summary> + /// <value>The start index.</value> + public int? StartIndex { get; set; } + + /// <summary> + /// The maximum number of items to return + /// </summary> + /// <value>The limit.</value> + public int? Limit { get; set; } + + public bool IncludePeople { get; set; } + public bool IncludeMedia { get; set; } + public bool IncludeGenres { get; set; } + public bool IncludeStudios { get; set; } + public bool IncludeArtists { get; set; } + + public SearchQuery() + { + IncludeArtists = true; + IncludeGenres = true; + IncludeMedia = true; + IncludePeople = true; + IncludeStudios = true; + } + } +} |
