Added Jump In - NameStartsWith

This commit is contained in:
tikuf 2014-03-06 08:46:32 +11:00
parent 9396f16aed
commit 0604d180ab
4 changed files with 35 additions and 0 deletions

View File

@ -174,6 +174,10 @@ namespace MediaBrowser.Api.UserLibrary
{ {
items = items.Where(i => string.Compare(request.NameStartsWithOrGreater, i.SortName, StringComparison.CurrentCultureIgnoreCase) < 1); items = items.Where(i => string.Compare(request.NameStartsWithOrGreater, i.SortName, StringComparison.CurrentCultureIgnoreCase) < 1);
} }
if (!string.IsNullOrEmpty(request.NameStartsWith))
{
items = items.Where(i => string.Compare(request.NameStartsWith, i.SortName.Substring(0, 1), StringComparison.CurrentCultureIgnoreCase) == 0);
}
if (!string.IsNullOrEmpty(request.NameLessThan)) if (!string.IsNullOrEmpty(request.NameLessThan))
{ {
@ -312,6 +316,8 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "NameStartsWithOrGreater", Description = "Optional filter by items whose name is sorted equally or greater than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "NameStartsWithOrGreater", Description = "Optional filter by items whose name is sorted equally or greater than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string NameStartsWithOrGreater { get; set; } public string NameStartsWithOrGreater { get; set; }
[ApiMember(Name = "NameStartsWith", Description = "Optional filter by items whose name is sorted equally than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string NameStartsWith { get; set; }
[ApiMember(Name = "NameLessThan", Description = "Optional filter by items whose name is sorted less than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "NameLessThan", Description = "Optional filter by items whose name is sorted less than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string NameLessThan { get; set; } public string NameLessThan { get; set; }

View File

@ -110,6 +110,11 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "NameStartsWithOrGreater", Description = "Optional filter by items whose name is sorted equally or greater than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "NameStartsWithOrGreater", Description = "Optional filter by items whose name is sorted equally or greater than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string NameStartsWithOrGreater { get; set; } public string NameStartsWithOrGreater { get; set; }
[ApiMember(Name = "NameStartsWith", Description = "Optional filter by items whose name is sorted equally than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string NameStartsWith { get; set; }
[ApiMember(Name = "NameLessThan", Description = "Optional filter by items whose name is equally or lesser than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string NameLessThan { get; set; }
[ApiMember(Name = "AlbumArtistStartsWithOrGreater", Description = "Optional filter by items whose album artist is sorted equally or greater than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "AlbumArtistStartsWithOrGreater", Description = "Optional filter by items whose album artist is sorted equally or greater than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string AlbumArtistStartsWithOrGreater { get; set; } public string AlbumArtistStartsWithOrGreater { get; set; }
@ -768,6 +773,15 @@ namespace MediaBrowser.Api.UserLibrary
{ {
items = items.Where(i => string.Compare(request.NameStartsWithOrGreater, i.SortName, StringComparison.CurrentCultureIgnoreCase) < 1); items = items.Where(i => string.Compare(request.NameStartsWithOrGreater, i.SortName, StringComparison.CurrentCultureIgnoreCase) < 1);
} }
if (!string.IsNullOrEmpty(request.NameStartsWith))
{
items = items.Where(i => string.Compare(request.NameStartsWith, i.SortName.Substring(0, 1), StringComparison.CurrentCultureIgnoreCase) == 0);
}
if (!string.IsNullOrEmpty(request.NameLessThan))
{
items = items.Where(i => string.Compare(request.NameLessThan, i.SortName, StringComparison.CurrentCultureIgnoreCase) == 1);
}
if (!string.IsNullOrEmpty(request.AlbumArtistStartsWithOrGreater)) if (!string.IsNullOrEmpty(request.AlbumArtistStartsWithOrGreater))
{ {

View File

@ -217,6 +217,17 @@ namespace MediaBrowser.Model.Querying
/// </summary> /// </summary>
/// <value>The name starts with or greater.</value> /// <value>The name starts with or greater.</value>
public string NameStartsWithOrGreater { get; set; } public string NameStartsWithOrGreater { get; set; }
/// <summary>
/// Gets or sets the name starts with.
/// </summary>
/// <value>The name starts with or greater.</value>
public string NameStartsWith { get; set; }
/// <summary>
/// Gets or sets the name starts with.
/// </summary>
/// <value>The name lessthan.</value>
public string NameLessThan { get; set; }
/// <summary> /// <summary>
/// Gets or sets the album artist starts with or greater. /// Gets or sets the album artist starts with or greater.

View File

@ -86,6 +86,10 @@ namespace MediaBrowser.Model.Querying
public string NameStartsWithOrGreater { get; set; } public string NameStartsWithOrGreater { get; set; }
/// <summary> /// <summary>
/// Gets or sets the name starts with
/// </summary>
/// <value>The name starts with or greater.</value>
public string NameStartsWith { get; set; }
/// Gets or sets the name less than. /// Gets or sets the name less than.
/// </summary> /// </summary>
/// <value>The name less than.</value> /// <value>The name less than.</value>