added a-z picker to more screens

This commit is contained in:
Luke Pulverenti 2013-05-16 16:46:18 -04:00
parent 5afa99d7cd
commit 0b61c31e0f
2 changed files with 10 additions and 2 deletions

View File

@ -133,6 +133,11 @@ namespace MediaBrowser.Api.UserLibrary
/// <returns>IEnumerable{IbnStub}.</returns>
private IEnumerable<IbnStub<TItemType>> FilterItems(GetItemsByName request, IEnumerable<IbnStub<TItemType>> items, User user)
{
if (!string.IsNullOrEmpty(request.NameStartsWith))
{
items = items.Where(i => i.Name.IndexOf(request.NameStartsWith, StringComparison.OrdinalIgnoreCase) == 0);
}
var filters = request.GetFilters().ToList();
if (filters.Count == 0)
@ -227,7 +232,7 @@ namespace MediaBrowser.Api.UserLibrary
items = items.Where(f => vals.Contains(f.MediaType ?? string.Empty, StringComparer.OrdinalIgnoreCase));
}
return items;
}
@ -304,6 +309,9 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public Guid? UserId { get; set; }
[ApiMember(Name = "NameStartsWith", Description = "Optional filter whose name begins with a prefix.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string NameStartsWith { get; set; }
/// <summary>
/// What to sort the results by
/// </summary>

View File

@ -127,7 +127,7 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "SeriesStatus", Description = "Optional filter by Series Status. Allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
public string SeriesStatus { get; set; }
[ApiMember(Name = "NameStartsWith", Description = "Optional filter whose name begins with a prefix.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
[ApiMember(Name = "NameStartsWith", Description = "Optional filter whose name begins with a prefix.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string NameStartsWith { get; set; }
/// <summary>