diff options
| author | Eric Reed <ebr@mediabrowser3.com> | 2013-05-17 11:53:13 -0400 |
|---|---|---|
| committer | Eric Reed <ebr@mediabrowser3.com> | 2013-05-17 11:53:13 -0400 |
| commit | 584641a6f43fee18f65dc9c8abd24b88742922ce (patch) | |
| tree | c25da5ee2b3819281cf20a0f847a0c89fef10adb /MediaBrowser.Api/UserLibrary/ItemsService.cs | |
| parent | 1b333d124487a49f221c4f09f259a1d1891c6b44 (diff) | |
| parent | da7af24fca3b2462b971dce595cfa5e548311cce (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ItemsService.cs')
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ItemsService.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index dc316cff1..c57778fd6 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -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)] public string SeriesStatus { get; set; } + [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; } + /// <summary> /// Gets or sets the air days. /// </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")] public bool? HasTrailer { get; set; } - + /// <summary> /// Gets the order by. /// </summary> @@ -450,7 +453,12 @@ namespace MediaBrowser.Api.UserLibrary var vals = request.IncludeItemTypes.Split(','); items = items.Where(f => vals.Contains(f.GetType().Name, StringComparer.OrdinalIgnoreCase)); } - + + if (!string.IsNullOrEmpty(request.NameStartsWithOrGreater)) + { + items = items.Where(i => string.Compare(request.NameStartsWithOrGreater, i.SortName, StringComparison.OrdinalIgnoreCase) < 1); + } + // Filter by Series Status 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)); } - + var imageTypes = GetImageTypes(request).ToArray(); if (imageTypes.Length > 0) { |
