aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/BaseApiService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-13 02:36:30 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-13 02:36:30 -0500
commite1b880a5a072764cabace79cd6d1d65315ec65e4 (patch)
tree971f995ffd89246ca96c80b44a6266315812e4de /MediaBrowser.Api/BaseApiService.cs
parentbff0cd4447119278d6aab5961f79f8a17c566a04 (diff)
update series queries
Diffstat (limited to 'MediaBrowser.Api/BaseApiService.cs')
-rw-r--r--MediaBrowser.Api/BaseApiService.cs32
1 files changed, 31 insertions, 1 deletions
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs
index 73a2bedb9..7a8951396 100644
--- a/MediaBrowser.Api/BaseApiService.cs
+++ b/MediaBrowser.Api/BaseApiService.cs
@@ -121,7 +121,9 @@ namespace MediaBrowser.Api
{
var options = new DtoOptions();
- options.DeviceId = authContext.GetAuthorizationInfo(Request).DeviceId;
+ var authInfo = authContext.GetAuthorizationInfo(Request);
+
+ options.DeviceId = authInfo.DeviceId;
var hasFields = request as IHasItemFields;
if (hasFields != null)
@@ -129,6 +131,34 @@ namespace MediaBrowser.Api
options.Fields = hasFields.GetItemFields().ToList();
}
+ var client = authInfo.Client ?? string.Empty;
+ if (client.IndexOf("kodi", StringComparison.OrdinalIgnoreCase) != -1 ||
+ client.IndexOf("wmc", StringComparison.OrdinalIgnoreCase) != -1 ||
+ client.IndexOf("media center", StringComparison.OrdinalIgnoreCase) != -1 ||
+ client.IndexOf("classic", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ options.Fields.Add(Model.Querying.ItemFields.RecursiveItemCount);
+ }
+
+ if (client.IndexOf("kodi", StringComparison.OrdinalIgnoreCase) != -1 ||
+ client.IndexOf("wmc", StringComparison.OrdinalIgnoreCase) != -1 ||
+ client.IndexOf("media center", StringComparison.OrdinalIgnoreCase) != -1 ||
+ client.IndexOf("classic", StringComparison.OrdinalIgnoreCase) != -1 ||
+ client.IndexOf("roku", StringComparison.OrdinalIgnoreCase) != -1 ||
+ client.IndexOf("samsung", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ options.Fields.Add(Model.Querying.ItemFields.ChildCount);
+ }
+
+ if (client.IndexOf("web", StringComparison.OrdinalIgnoreCase) == -1 &&
+ client.IndexOf("mobile", StringComparison.OrdinalIgnoreCase) == -1 &&
+ client.IndexOf("ios", StringComparison.OrdinalIgnoreCase) == -1 &&
+ client.IndexOf("android", StringComparison.OrdinalIgnoreCase) == -1 &&
+ client.IndexOf("theater", StringComparison.OrdinalIgnoreCase) == -1)
+ {
+ options.Fields.Add(Model.Querying.ItemFields.ChildCount);
+ }
+
var hasDtoOptions = request as IHasDtoOptions;
if (hasDtoOptions != null)
{