aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/UserLibrary/ItemsService.cs
diff options
context:
space:
mode:
authorTim Hobbs <jesus.tesh@gmail.com>2014-03-13 06:36:39 -0700
committerTim Hobbs <jesus.tesh@gmail.com>2014-03-13 06:36:39 -0700
commit9976857e785d7e76807e02798480a063f9f3defa (patch)
tree0335c9e5ffabc49fd88150b297860af4fe04a0d6 /MediaBrowser.Api/UserLibrary/ItemsService.cs
parenta402d3ea9232799b136b0dc8e9936ebfb286b7f5 (diff)
parentb7bcc2450694105de9f9fc8cc07d2cfc4d9d7c96 (diff)
Merge remote-tracking branch 'upstream/master' into ribbons
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ItemsService.cs')
-rw-r--r--MediaBrowser.Api/UserLibrary/ItemsService.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs
index 871c9aecb..b040d3dd8 100644
--- a/MediaBrowser.Api/UserLibrary/ItemsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs
@@ -111,6 +111,12 @@ 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")]
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")]
public string AlbumArtistStartsWithOrGreater { get; set; }
@@ -768,6 +774,15 @@ namespace MediaBrowser.Api.UserLibrary
{
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))
{