added an alphabet picker to some screens

This commit is contained in:
Luke Pulverenti 2013-05-16 15:00:42 -04:00
parent 23d9d4ef73
commit a77a14eaf6
2 changed files with 12 additions and 4 deletions

View file

@ -75,7 +75,7 @@ namespace MediaBrowser.Api.Library
throw new DirectoryNotFoundException("The media collection does not exist"); throw new DirectoryNotFoundException("The media collection does not exist");
} }
if (Directory.Exists(newPath)) if (!string.Equals(currentPath, newPath, StringComparison.OrdinalIgnoreCase) && Directory.Exists(newPath))
{ {
throw new ArgumentException("There is already a media collection with the name " + newPath + "."); throw new ArgumentException("There is already a media collection with the name " + newPath + ".");
} }

View file

@ -127,6 +127,9 @@ 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)] [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; } 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)]
public string NameStartsWith { get; set; }
/// <summary> /// <summary>
/// Gets or sets the air days. /// Gets or sets the air days.
/// </summary> /// </summary>
@ -162,7 +165,7 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "HasTrailer", Description = "Optional filter by items with trailers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "HasTrailer", Description = "Optional filter by items with trailers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public bool? HasTrailer { get; set; } public bool? HasTrailer { get; set; }
/// <summary> /// <summary>
/// Gets the order by. /// Gets the order by.
/// </summary> /// </summary>
@ -450,7 +453,12 @@ namespace MediaBrowser.Api.UserLibrary
var vals = request.IncludeItemTypes.Split(','); var vals = request.IncludeItemTypes.Split(',');
items = items.Where(f => vals.Contains(f.GetType().Name, StringComparer.OrdinalIgnoreCase)); items = items.Where(f => vals.Contains(f.GetType().Name, StringComparer.OrdinalIgnoreCase));
} }
if (!string.IsNullOrEmpty(request.NameStartsWith))
{
items = items.Where(i => i.Name.IndexOf(request.NameStartsWith, StringComparison.OrdinalIgnoreCase) == 0);
}
// Filter by Series Status // Filter by Series Status
if (!string.IsNullOrEmpty(request.SeriesStatus)) if (!string.IsNullOrEmpty(request.SeriesStatus))
{ {
@ -489,7 +497,7 @@ namespace MediaBrowser.Api.UserLibrary
items = items.Where(i => !string.IsNullOrEmpty(i.MediaType) && types.Contains(i.MediaType, StringComparer.OrdinalIgnoreCase)); items = items.Where(i => !string.IsNullOrEmpty(i.MediaType) && types.Contains(i.MediaType, StringComparer.OrdinalIgnoreCase));
} }
var imageTypes = GetImageTypes(request).ToArray(); var imageTypes = GetImageTypes(request).ToArray();
if (imageTypes.Length > 0) if (imageTypes.Length > 0)
{ {